Message.IDisposable.Dispose Message.IDisposable.Dispose Message.IDisposable.Dispose Method

定义

关闭此消息使用的所有资源。Closes all the resources used by this message. 不能继承此方法。This method cannot be inherited.

 virtual void System.IDisposable.Dispose() = IDisposable::Dispose;
void IDisposable.Dispose ();
Sub Dispose () Implements IDisposable.Dispose

实现

注解

使用完 Message 后调用此方法。Call this method when you are finished using the Message. 此方法使 Message 处于不可用状态。This method leaves the Message in an unusable state. 调用此方法后,必须释放对所有引用Message这样垃圾回收器才能收回内存的Message所在。After calling this method, you must release all references to the Message so the garbage collector can reclaim the memory that the Message resided in.

备注

每次释放对 Message 的最后一个引用之前,均应调用此方法。Always call this method before you release your last reference to the Message. 否则,在垃圾回收器调用 Message 对象的 Finalize 方法之前,不会释放正在使用的资源。Otherwise, the resources it is using are not freed until the garbage collector calls the Message object's Finalize method.

适用于