Debugger: Fixed a rare deadlock when closing debugger at the same time as loading a rom

This commit is contained in:
Souryo 2017-05-02 21:34:04 -04:00
parent fbc94bee7d
commit 562f3be5d3
2 changed files with 12 additions and 14 deletions

View file

@ -18,15 +18,6 @@ namespace Mesen.GUI.Debugger
if(disposing && (components != null)) {
components.Dispose();
}
LabelManager.OnLabelUpdated -= LabelManager_OnLabelUpdated;
BreakpointManager.BreakpointsChanged -= BreakpointManager_BreakpointsChanged;
ctrlConsoleStatus.OnStateChanged -= ctrlConsoleStatus_OnStateChanged;
ctrlProfiler.OnFunctionSelected -= ctrlProfiler_OnFunctionSelected;
if(_notifListener != null) {
_notifListener.Dispose();
_notifListener = null;
}
base.Dispose(disposing);
}
@ -1201,7 +1192,6 @@ namespace Mesen.GUI.Debugger
this.MinimumSize = new System.Drawing.Size(1000, 725);
this.Name = "frmDebugger";
this.Text = "Debugger";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmDebugger_FormClosed);
this.splitContainer.Panel1.ResumeLayout(false);
this.splitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();

View file

@ -385,10 +385,6 @@ namespace Mesen.GUI.Debugger
ResumeExecution();
}
private void frmDebugger_FormClosed(object sender, FormClosedEventArgs e)
{
InteropEmu.DebugRelease();
}
private void mnuToggleBreakpoint_Click(object sender, EventArgs e)
{
@ -537,6 +533,18 @@ namespace Mesen.GUI.Debugger
protected override void OnFormClosed(FormClosedEventArgs e)
{
LabelManager.OnLabelUpdated -= LabelManager_OnLabelUpdated;
BreakpointManager.BreakpointsChanged -= BreakpointManager_BreakpointsChanged;
ctrlConsoleStatus.OnStateChanged -= ctrlConsoleStatus_OnStateChanged;
ctrlProfiler.OnFunctionSelected -= ctrlProfiler_OnFunctionSelected;
if(_notifListener != null) {
_notifListener.Dispose();
_notifListener = null;
}
InteropEmu.DebugRelease();
ConfigManager.Config.DebugInfo.WindowWidth = this.Width;
ConfigManager.Config.DebugInfo.WindowHeight = this.Height;
ConfigManager.Config.DebugInfo.TopPanelHeight = this.splitContainer.GetSplitterDistance();