Exemple #1
0
        protected override void Dispose(bool disposing)
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Dispose() of: {0}", this.ToString()));
            Debug.Assert(disposing);

            if (m_ExpressionCompilerThread != null)
            {
                m_ExpressionCompilerThread.Dispose();
                m_ExpressionCompilerThread = null;
            }

            PackageGlobals.DeinitInstance();

            if (m_UpdateTimer != null)
            {
                m_UpdateTimer.Stop();
            }

            IVsSolution vs_solution = (IVsSolution)GetService(typeof(IVsSolution));

            if (vs_solution != null)
            {
                vs_solution.UnadviseSolutionEvents(m_SolutionEventsCookie);
            }

            IVsDebugger debugger = (IVsDebugger)GetService(typeof(IVsDebugger));

            if (debugger != null)
            {
                debugger.UnadviseDebuggerEvents(m_DebuggerEventsCookie);
            }

            if (m_VSMainWindow != null)
            {
                m_VSMainWindow.Deinitialize();
                m_VSMainWindow = null;
            }

            base.Dispose(disposing);
        }