Send a call when we're ready to teardown GS handler.

Instead of polling for the threadDone variable.
This commit is contained in:
Jean-Philip Desjardins 2018-06-03 17:59:10 -04:00
parent 2767ec9785
commit a1fbc9222e

View File

@ -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();