diff options
Diffstat (limited to 'src/wx/main.cpp')
-rw-r--r-- | src/wx/main.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/wx/main.cpp b/src/wx/main.cpp index 058808f..a5fd725 100644 --- a/src/wx/main.cpp +++ b/src/wx/main.cpp @@ -130,10 +130,18 @@ MainFrame::MainFrame() void MainFrame::OnClose(wxCloseEvent& event) { - emustatus = 0; - emustatuschangemutex->Lock(); - emustatuschange->Signal(); - emustatuschangemutex->Unlock(); + if (emustatus == 1) + { + emustatus = 0; + emustop->Wait(); + } + else + { + emustatus = 0; + emustatuschangemutex->Lock(); + emustatuschange->Signal(); + emustatuschangemutex->Unlock(); + } emuthread->Wait(); delete emuthread; |