diff options
| author | Jules Blok <jules.blok@gmail.com> | 2014-06-20 02:43:57 +0200 |
|---|---|---|
| committer | Jules Blok <jules.blok@gmail.com> | 2014-07-08 21:21:23 +0200 |
| commit | 3266394dfbb564f69e3cd6470ad608a4db314916 (patch) | |
| tree | c867e081920c9c8c31fbe7bc0e47ca8c6aa2d3ec /Source/Core/DolphinWX/Frame.cpp | |
| parent | ff6fa68b71989bbc528654dca3b7d541fedc05f6 (diff) | |
Make the emulation stop asynchronous to prevent deadlocks.
This may expose bugs which relied on the Main Thread to be suspended in the stopping state.
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Frame.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 5284eefd57..1807c5e53b 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -425,6 +425,7 @@ CFrame::CFrame(wxFrame* parent, Movie::SetInputManip(TASManipFunction); State::SetOnAfterLoadCallback(OnAfterLoadCallback); + Core::SetOnStoppedCallback(OnStoppedCallback); // Setup perspectives if (g_pCodeWindow) @@ -692,6 +693,10 @@ void CFrame::OnHostMessage(wxCommandEvent& event) case WM_USER_STOP: DoStop(); break; + + case IDM_STOPPED: + OnStopped(); + break; } } @@ -904,6 +909,16 @@ void OnAfterLoadCallback() } } +void OnStoppedCallback() +{ + // warning: this gets called from the EmuThread, so we should only queue things to do on the proper thread + if (main_frame) + { + wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_STOPPED); + main_frame->GetEventHandler()->AddPendingEvent(event); + } +} + void TASManipFunction(SPADStatus *PadStatus, int controllerID) { if (main_frame) |
