From 302cae5c2fa786b16ca4f99cb56afd1f04eb7c99 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 13 Jul 2019 19:52:56 +0200 Subject: [PATCH] CEventLoop: When asked to exit the event loop, exit right away. Don't process any more events. We already prepend the remaining events in this loop to the outer loop if needed. If there were any more events queued after the exit request, the iteration code would make an invalid access into 'queued_events'. Fixes #300. --- Libraries/LibCore/CEventLoop.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/LibCore/CEventLoop.cpp b/Libraries/LibCore/CEventLoop.cpp index e38c2b2154..090f2a20af 100644 --- a/Libraries/LibCore/CEventLoop.cpp +++ b/Libraries/LibCore/CEventLoop.cpp @@ -139,6 +139,7 @@ void CEventLoop::pump(WaitMode mode) auto rejigged_event_queue = move(events); rejigged_event_queue.append(move(m_queued_events)); m_queued_events = move(rejigged_event_queue); + return; } } }