From 4883fa268fa60751a2c1fc0dd77ce022987daf21 Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 26 Feb 2013 16:42:32 +0100 Subject: Split VideoBackend::Cleanup from Shutdown. First is called from ogl/d3d thread, second is called from emulation thread (x11...) --- Source/Core/Common/Src/VideoBackendBase.h | 1 + Source/Core/Core/Src/Core.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'Source/Core') diff --git a/Source/Core/Common/Src/VideoBackendBase.h b/Source/Core/Common/Src/VideoBackendBase.h index 311fa66104..4454bde8a7 100644 --- a/Source/Core/Common/Src/VideoBackendBase.h +++ b/Source/Core/Common/Src/VideoBackendBase.h @@ -102,6 +102,7 @@ public: virtual void Video_Prepare() = 0; virtual void Video_EnterLoop() = 0; virtual void Video_ExitLoop() = 0; + virtual void Video_Cleanup() = 0; // called from gl/d3d thread virtual void Video_BeginField(u32, FieldType, u32, u32) = 0; virtual void Video_EndField() = 0; diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index a6c07eeaaa..87348e5a74 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -323,6 +323,9 @@ void CpuThread() CCPU::Run(); g_bStarted = false; + + if (!_CoreParameter.bCPUThread) + g_video_backend->Video_Cleanup(); return; } @@ -351,6 +354,9 @@ void FifoPlayerThread() } g_bStarted = false; + + if(!_CoreParameter.bCPUThread) + g_video_backend->Video_Cleanup(); return; } @@ -477,6 +483,9 @@ void EmuThread() g_cpu_thread.join(); INFO_LOG(CONSOLE, "%s", StopMessage(true, "CPU thread stopped.").c_str()); + + if(_CoreParameter.bCPUThread) + g_video_backend->Video_Cleanup(); VolumeHandler::EjectVolume(); FileMon::Close(); -- cgit v1.2.3