dont crash on exit
This commit is contained in:
parent
005138b453
commit
64f0681fcd
|
@ -29,6 +29,7 @@ namespace BizHawk.MultiClient
|
||||||
public int FrameAdvanceDelay;
|
public int FrameAdvanceDelay;
|
||||||
public bool runloop_frameProgress;
|
public bool runloop_frameProgress;
|
||||||
public bool skipnextframe;
|
public bool skipnextframe;
|
||||||
|
public bool exit;
|
||||||
}
|
}
|
||||||
MainLoopData mainLoopData = new MainLoopData();
|
MainLoopData mainLoopData = new MainLoopData();
|
||||||
public bool EmulatorPaused;
|
public bool EmulatorPaused;
|
||||||
|
@ -144,6 +145,12 @@ namespace BizHawk.MultiClient
|
||||||
throttle = new Throttle(30);
|
throttle = new Throttle(30);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnClosed(EventArgs e)
|
||||||
|
{
|
||||||
|
mainLoopData.exit = true;
|
||||||
|
base.OnClosed(e);
|
||||||
|
}
|
||||||
|
|
||||||
public void ProgramRunLoop()
|
public void ProgramRunLoop()
|
||||||
{
|
{
|
||||||
for (; ; )
|
for (; ; )
|
||||||
|
@ -158,6 +165,8 @@ namespace BizHawk.MultiClient
|
||||||
Render();
|
Render();
|
||||||
|
|
||||||
CheckMessages();
|
CheckMessages();
|
||||||
|
if (mainLoopData.exit)
|
||||||
|
break;
|
||||||
Thread.Sleep(0);
|
Thread.Sleep(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue