diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 8a502b5ef2..2dfd7ffa2e 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -119,6 +119,12 @@ void Fifo_ExitLoop() #endif } +// May be executed from any thread, even the graphics thread. +// Created to allow for self shutdown. +void Fifo_ExitLoopNonBlocking() { + fifoStateRun = false; +} + // void Fifo_EnterLoop(const SVideoInitialize &video_initialize) { diff --git a/Source/Core/VideoCommon/Src/Fifo.h b/Source/Core/VideoCommon/Src/Fifo.h index c0148ef99c..b71e3155d6 100644 --- a/Source/Core/VideoCommon/Src/Fifo.h +++ b/Source/Core/VideoCommon/Src/Fifo.h @@ -33,6 +33,7 @@ void Fifo_Shutdown(); // These two are for dual core mode only. void Fifo_EnterLoop(const SVideoInitialize &video_initialize); void Fifo_ExitLoop(); +void Fifo_ExitLoopNonBlocking(); void Fifo_DoState(PointerWrap &f); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp b/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp index f9495cea44..4f36f675fb 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp @@ -5,6 +5,7 @@ #include "Config.h" #include "main.h" #include "EmuWindow.h" +#include "Fifo.h" namespace EmuWindow { @@ -52,6 +53,7 @@ namespace EmuWindow break; case WM_CLOSE: + Fifo_ExitLoopNonBlocking(); Shutdown(); // Simple hack to easily exit without stopping. Hope to fix the stopping errors soon. ExitProcess(0);