fix hang when closing an instance that is engaged into local multiplayer
This commit is contained in:
parent
e3e561da3f
commit
09e4400f3c
|
@ -154,8 +154,6 @@ EmuInstance::~EmuInstance()
|
||||||
deleting = true;
|
deleting = true;
|
||||||
deleteAllWindows();
|
deleteAllWindows();
|
||||||
|
|
||||||
MPInterface::Get().End(instanceID);
|
|
||||||
|
|
||||||
emuThread->emuExit();
|
emuThread->emuExit();
|
||||||
emuThread->wait();
|
emuThread->wait();
|
||||||
delete emuThread;
|
delete emuThread;
|
||||||
|
|
|
@ -478,7 +478,8 @@ void EmuThread::waitMessage(int num)
|
||||||
void EmuThread::waitAllMessages()
|
void EmuThread::waitAllMessages()
|
||||||
{
|
{
|
||||||
if (QThread::currentThread() == this) return;
|
if (QThread::currentThread() == this) return;
|
||||||
msgSemaphore.acquire(msgSemaphore.available());
|
while (!msgQueue.empty())
|
||||||
|
msgSemaphore.acquire();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmuThread::handleMessages()
|
void EmuThread::handleMessages()
|
||||||
|
@ -494,6 +495,7 @@ void EmuThread::handleMessages()
|
||||||
emuPauseStack = emuPauseStackRunning;
|
emuPauseStack = emuPauseStackRunning;
|
||||||
|
|
||||||
emuInstance->audioDisable();
|
emuInstance->audioDisable();
|
||||||
|
MPInterface::Get().End(emuInstance->instanceID);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case msg_EmuRun:
|
case msg_EmuRun:
|
||||||
|
|
Loading…
Reference in New Issue