From c42f680c755d54a50544fe5ecca64f09109256af Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sun, 30 Aug 2015 08:47:50 -0300 Subject: [PATCH] citra-qt: Move system shutdown to run inside EmuThread This stops (for some reason sporadic) crashes and OpenGL errors during shutdown, when the OpenGL renderer tries to clean up objects from the UI thread, which has no OpenGL context active. --- src/citra_qt/bootmanager.cpp | 3 +++ src/citra_qt/main.cpp | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index d9bacfc3d7..9aec165069 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -72,6 +72,9 @@ void EmuThread::run() { } } + // Shutdown the core emulation + System::Shutdown(); + MicroProfileOnThreadExit(); render_window->moveContext(); diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 7fb1b0dcbc..11813a2a8a 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -283,9 +283,6 @@ void GMainWindow::ShutdownGame() { emu_thread->wait(); emu_thread = nullptr; - // Shutdown the core emulation - System::Shutdown(); - // Update the GUI ui.action_Start->setEnabled(false); ui.action_Start->setText(tr("Start"));