/// ----------------------------------------------------------------------------------- /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged /// resources; <c>false</c> to release only unmanaged resources. /// </param> /// ----------------------------------------------------------------------------------- protected override void Dispose(bool disposing) { //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************"); // Must not be run more than once. if (IsDisposed) return; // m_sda COM object block removed due to crash in Finializer thread LT-6124 if (disposing) { // Do this first, before setting m_fDisposing to true. if (m_sda != null) m_sda.RemoveNotification(this); m_fDisposing = true; // 'Disposing' isn't until we call base dispose. m_currentSlice = null; if (m_rch != null) { if (m_rch.HasRecordListUpdater) { m_rch.Fixup(false); // no need to refresh record list on shutdown. } else if (m_rch is IDisposable) { // It's fine to dispose it, after all, because m_rch has no other owner. (m_rch as IDisposable).Dispose(); } } if (m_tooltip != null) { m_tooltip.RemoveAll(); m_tooltip.Dispose(); } foreach (Slice slice in Controls) slice.ShowContextMenu -= new TreeNodeEventHandler(this.OnShowContextMenu); } m_sda = null; m_currentSlice = null; m_root = null; m_cache = null; m_mdc = null; m_autoCustomFieldNodesDocument = null; m_autoCustomFieldNodesDocRoot = null; m_rch = null; m_rootLayoutName = null; m_smallImages = null; // Client has to deal with it, since it gave it to us. // protected AutoDataTreeMenuHandler m_autoHandler; // No tusing this data member. m_layoutInventory = null; m_partInventory = null; m_sliceFilter = null; m_monitoredProps = null; m_stringTable = null; m_persistenceProvider = null; m_styleSheet = null; // We may have made it, or been given it. m_tooltip = null; m_mediator = null; m_rlu = null; base.Dispose(disposing); // This will call Dispose on each Slice. }
/// ----------------------------------------------------------------------------------- /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged /// resources; <c>false</c> to release only unmanaged resources. /// </param> /// ----------------------------------------------------------------------------------- protected override void Dispose(bool disposing) { System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** "); // Must not be run more than once. if (IsDisposed) return; // m_sda COM object block removed due to crash in Finializer thread LT-6124 if (disposing) { // Do this first, before setting m_fDisposing to true. if (m_sda != null) m_sda.RemoveNotification(this); // We'd prefer to do any cleanup of the current slice BEFORE its parent gets disposed. // But I can't find any event that is raised before Dispose when switching areas. // To avoid losing changes (e.g., in InterlinearSlice/ Words Analysis view), let the current // slice know it is no longer current, if we haven't already done so. if (m_currentSlice != null && !m_currentSlice.IsDisposed) m_currentSlice.SetCurrentState(false); m_currentSlice = null; m_fDisposing = true; // 'Disposing' isn't until we call base dispose. if (m_rch != null) { if (m_rch.HasRecordListUpdater) m_rch.Fixup(false); // no need to refresh record list on shutdown. else // It's fine to dispose it, after all, because m_rch has no other owner. m_rch.Dispose(); } if (m_tooltip != null) { m_tooltip.RemoveAll(); m_tooltip.Dispose(); } foreach (Slice slice in Slices) slice.ShowContextMenu -= OnShowContextMenu; } m_sda = null; m_currentSlice = null; m_root = null; m_cache = null; m_mdc = null; m_autoCustomFieldNodesDocument = null; m_autoCustomFieldNodesDocRoot = null; m_rch = null; m_rootLayoutName = null; m_smallImages = null; // Client has to deal with it, since it gave it to us. // protected AutoDataTreeMenuHandler m_autoHandler; // No tusing this data member. m_layoutInventory = null; m_partInventory = null; m_sliceFilter = null; m_monitoredProps = null; m_stringTable = null; m_persistenceProvider = null; m_styleSheet = null; // We may have made it, or been given it. m_tooltip = null; m_mediator = null; m_rlu = null; base.Dispose(disposing); // This will call Dispose on each Slice. }