From a1fbc9222efee7db98c7dee08ebd52ca944f91f4 Mon Sep 17 00:00:00 2001 From: Jean-Philip Desjardins Date: Sun, 3 Jun 2018 17:59:10 -0400 Subject: [PATCH] Send a call when we're ready to teardown GS handler. Instead of polling for the threadDone variable. --- Source/gs/GSHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/gs/GSHandler.cpp b/Source/gs/GSHandler.cpp index 0efdf066..4cadbb33 100644 --- a/Source/gs/GSHandler.cpp +++ b/Source/gs/GSHandler.cpp @@ -102,7 +102,7 @@ CGSHandler::CGSHandler() CGSHandler::~CGSHandler() { - m_threadDone = true; + m_mailBox.SendCall([this]() { m_threadDone = true; }); m_thread.join(); delete[] m_pRAM; delete[] m_pCLUT; @@ -1669,7 +1669,7 @@ void CGSHandler::ThreadProc() { while(!m_threadDone) { - m_mailBox.WaitForCall(100); + m_mailBox.WaitForCall(); while(m_mailBox.IsPending()) { m_mailBox.ReceiveCall();