Skip to content

Commit a4d41fa

Browse files
Fix occasional segfault on exit caused by emuIsActive being called after
the EmuThread is destroyed
1 parent fc00402 commit a4d41fa

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/frontend/qt_sdl/EmuInstance.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ EmuInstance::~EmuInstance()
161161
emuThread->emuExit();
162162
emuThread->wait();
163163
delete emuThread;
164+
emuThread = nullptr;
164165

165166
net.UnregisterInstance(instanceID);
166167

@@ -344,6 +345,8 @@ void EmuInstance::osdAddMessage(unsigned int color, const char* fmt, ...)
344345

345346
bool EmuInstance::emuIsActive()
346347
{
348+
if (emuThread == nullptr)
349+
return false;
347350
return emuThread->emuIsActive();
348351
}
349352

0 commit comments

Comments
 (0)