diff options
Diffstat (limited to 'backends/events/default/default-events.cpp')
-rw-r--r-- | backends/events/default/default-events.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index 24750d038c..b91643c6fb 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -478,7 +478,13 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { } void DefaultEventManager::pushEvent(Common::Event event) { - artificialEventQueue.push(event); + + // If already received an EVENT_QUIT, don't add another one + if (event.type == Common::EVENT_QUIT) { + if (!_shouldQuit) + artificialEventQueue.push(event); + } else + artificialEventQueue.push(event); } #endif // !defined(DISABLE_DEFAULT_EVENTMANAGER) |