Exemplo n.º 1
0
 public void ShowButton()
 {
     if (dialog != null)
     {
         dialog.Destroy();
         dialog = null;
     }
     if (button == null)
     {
         button = new ExceptionCaughtButton(ex, this, File, Line);
         TextEditorService.RegisterExtension(button);
     }
     if (miniButton != null)
     {
         miniButton.Dispose();
         miniButton = null;
     }
 }
Exemplo n.º 2
0
        static void Cleanup()
        {
            if (oldLayout != null)
            {
                string layout = oldLayout;
                oldLayout = null;
                // Dispatch asynchronously to avoid start/stop races
                DispatchService.GuiSyncDispatch(delegate {
                    if (IdeApp.Workbench.CurrentLayout == "Debug")
                    {
                        IdeApp.Workbench.CurrentLayout = layout;
                    }
                });
            }

            currentBacktrace = null;

            if (!IsDebugging)
            {
                return;
            }

            if (exceptionDialog != null)
            {
                exceptionDialog.Destroy();
                exceptionDialog = null;
            }

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

            session.TargetEvent           -= OnTargetEvent;
            session.TargetStarted         -= OnStarted;
            session.OutputWriter           = null;
            session.LogWriter              = null;
            session.BusyStateChanged      -= OnBusyStateChanged;
            session.TypeResolverHandler    = null;
            session.BreakpointTraceHandler = null;
            session.GetExpressionEvaluator = null;
            console.CancelRequested       -= OnCancelRequested;

            // Dispose the session at the end, since it may take a while.
            DebuggerSession oldSession = session;

            session = null;

            DispatchService.GuiDispatch(delegate {
                if (StoppedEvent != null)
                {
                    StoppedEvent(null, new EventArgs());
                }
            });

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

            DispatchService.GuiDispatch(delegate {
                NotifyCallStackChanged();
                NotifyCurrentFrameChanged();
                NotifyLocationChanged();
            });

            if (oldSession != null)
            {
                oldSession.BusyStateChanged -= OnBusyStateChanged;
                oldSession.Dispose();
            }
        }