mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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.
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user