Skip to content

Commit 4db2ec7

Browse files
committed
Fix deadlock on linux messaging
1 parent e8c9533 commit 4db2ec7

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

modules/yup_events/native/yup_Messaging_linux.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,16 +338,17 @@ bool yup_dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages)
338338
if (LinuxErrorHandling::keyboardBreakOccurred)
339339
YUPApplicationBase::quit();
340340

341-
if (auto* runLoop = InternalRunLoop::getInstanceWithoutCreating())
342-
{
343-
if (runLoop->dispatchPendingEvents())
344-
break;
341+
auto* runLoop = InternalRunLoop::getInstanceWithoutCreating();
342+
if (runLoop == nullptr)
343+
return false;
345344

346-
if (returnIfNoPendingMessages)
347-
return false;
345+
if (runLoop->dispatchPendingEvents())
346+
break;
348347

349-
runLoop->sleepUntilNextEvent (2000);
350-
}
348+
if (returnIfNoPendingMessages)
349+
return false;
350+
351+
runLoop->sleepUntilNextEvent (2000);
351352
}
352353

353354
return true;

0 commit comments

Comments
 (0)