private void DisposeImpl(bool disposing) { if (this.handle != IntPtr.Zero) { if (disposing) { allPanels.Remove(this.handle); } CursesMethods.del_panel(this.handle); this.handle = IntPtr.Zero; this.window = null; } }
/// <summary> /// The bulk of the clean-up code is implemented in Dispose(bool) /// </summary> /// <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (disposing) { // free managed resources if (this.window != null) { this.window.Dispose(); this.window = null; } } // free native resources if there are any. if (this.handle != IntPtr.Zero) { if (disposing) { allPanels.Remove(this.handle); } CursesMethods.del_panel(this.handle); this.handle = IntPtr.Zero; } }