Menu.Dispose(Boolean) 方法
定义
protected:
override void Dispose(bool disposing);
protected override void Dispose (bool disposing);
override this.Dispose : bool -> unit
Protected Overrides Sub Dispose (disposing As Boolean)
参数
- disposing
- Boolean
若要释放托管资源和非托管资源,则为 true;若仅释放非托管资源,则为 false。true to release both managed and unmanaged resources; false to release only unmanaged resources.
注解
在完成使用 Dispose 后,应调用 Menu。Call Dispose when you are finished using the Menu. Dispose 方法使 Menu 处于不可用状态。The Dispose method leaves the Menu in an unusable state. 调用后 Dispose ,必须释放对的所有引用, Menu 以使其占用的内存可通过垃圾回收进行回收。After calling Dispose, you must release all references to the Menu so the memory it was occupying can be reclaimed by garbage collection.
备注
每次释放对 Dispose 的最后一个引用前,均应调用 Menu。Always call Dispose before you release your last reference to the Menu. 否则,在垃圾回收 Menu 调用 Menu 对象的析构函数之前,将不会释放正在使用的资源。Otherwise, the resources the Menu is using will not be freed until garbage collection calls the Menu object's destructor.