mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 06:51:17 +01:00
Revert "Join the emu thread in Core::Stop. Get rid of Core::Shutdown which did that before."
This reverts commit ba664b3293e88ddee94a4b922ced192f3270b569. Added documentation to Core::Shutdown() to prevent breaking changes.
This commit is contained in:
parent
2c7ae7787d
commit
59eb7a864d
@ -277,8 +277,6 @@ void Stop() // - Hammertime!
|
|||||||
|
|
||||||
g_video_backend->Video_ExitLoop();
|
g_video_backend->Video_ExitLoop();
|
||||||
}
|
}
|
||||||
if (s_emu_thread.joinable())
|
|
||||||
s_emu_thread.join();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DeclareAsCPUThread()
|
static void DeclareAsCPUThread()
|
||||||
@ -813,6 +811,18 @@ void UpdateTitle()
|
|||||||
Host_UpdateTitle(SMessage);
|
Host_UpdateTitle(SMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Shutdown()
|
||||||
|
{
|
||||||
|
// During shutdown DXGI expects us to handle some messages on the UI thread.
|
||||||
|
// Therefore we can't immediately block and wait for the emu thread to shut
|
||||||
|
// down, so we join the emu thread as late as possible when the UI has already
|
||||||
|
// shut down.
|
||||||
|
// For more info read "DirectX Graphics Infrastructure (DXGI): Best Practices"
|
||||||
|
// on MSDN.
|
||||||
|
if (s_emu_thread.joinable())
|
||||||
|
s_emu_thread.join();
|
||||||
|
}
|
||||||
|
|
||||||
void SetOnStoppedCallback(StoppedCallbackFunc callback)
|
void SetOnStoppedCallback(StoppedCallbackFunc callback)
|
||||||
{
|
{
|
||||||
s_on_stopped_callback = callback;
|
s_on_stopped_callback = callback;
|
||||||
|
@ -39,6 +39,7 @@ enum EState
|
|||||||
|
|
||||||
bool Init();
|
bool Init();
|
||||||
void Stop();
|
void Stop();
|
||||||
|
void Shutdown();
|
||||||
|
|
||||||
std::string StopMessage(bool, const std::string&);
|
std::string StopMessage(bool, const std::string&);
|
||||||
|
|
||||||
|
@ -364,6 +364,7 @@ void DolphinApp::OnEndSession(wxCloseEvent& event)
|
|||||||
|
|
||||||
int DolphinApp::OnExit()
|
int DolphinApp::OnExit()
|
||||||
{
|
{
|
||||||
|
Core::Shutdown();
|
||||||
UICommon::Shutdown();
|
UICommon::Shutdown();
|
||||||
|
|
||||||
delete m_locale;
|
delete m_locale;
|
||||||
|
@ -622,6 +622,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
|
|||||||
updateMainFrameEvent.Wait();
|
updateMainFrameEvent.Wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::Shutdown();
|
||||||
UICommon::Shutdown();
|
UICommon::Shutdown();
|
||||||
ANativeWindow_release(surf);
|
ANativeWindow_release(surf);
|
||||||
}
|
}
|
||||||
|
@ -359,6 +359,7 @@ int main(int argc, char* argv[])
|
|||||||
while (PowerPC::GetState() != PowerPC::CPU_POWERDOWN)
|
while (PowerPC::GetState() != PowerPC::CPU_POWERDOWN)
|
||||||
updateMainFrameEvent.Wait();
|
updateMainFrameEvent.Wait();
|
||||||
|
|
||||||
|
Core::Shutdown();
|
||||||
platform->Shutdown();
|
platform->Shutdown();
|
||||||
UICommon::Shutdown();
|
UICommon::Shutdown();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user