fix hang when closing an instance that is engaged into local multiplayer

This commit is contained in:
Arisotura 2024-11-01 00:40:09 +01:00
parent e3e561da3f
commit 09e4400f3c
2 changed files with 3 additions and 3 deletions

View File

@ -154,8 +154,6 @@ EmuInstance::~EmuInstance()
deleting = true;
deleteAllWindows();
MPInterface::Get().End(instanceID);
emuThread->emuExit();
emuThread->wait();
delete emuThread;

View File

@ -478,7 +478,8 @@ void EmuThread::waitMessage(int num)
void EmuThread::waitAllMessages()
{
if (QThread::currentThread() == this) return;
msgSemaphore.acquire(msgSemaphore.available());
while (!msgQueue.empty())
msgSemaphore.acquire();
}
void EmuThread::handleMessages()
@ -494,6 +495,7 @@ void EmuThread::handleMessages()
emuPauseStack = emuPauseStackRunning;
emuInstance->audioDisable();
MPInterface::Get().End(emuInstance->instanceID);
break;
case msg_EmuRun: