From 9170d916a0f5a6478621fc1220fbb54ef17bccba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Gallet?= Date: Mon, 8 Apr 2019 12:57:20 +0200 Subject: [PATCH] Fix some game exits --- src/library/frame.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/library/frame.cpp b/src/library/frame.cpp index 42ff07e4..3164e32c 100644 --- a/src/library/frame.cpp +++ b/src/library/frame.cpp @@ -179,11 +179,21 @@ void frameBoundary(bool drawFB, std::function draw, bool restore_screen) ThreadManager::setMainThread(); /* If the game is exiting, dont process the frame boundary, just draw and exit */ - // if (is_exiting) { - // detTimer.flushDelay(); - // NATIVECALL(draw()); - // return; - // } + if (is_exiting) { + detTimer.flushDelay(); + NATIVECALL(draw()); + + /* Still push native events so that the game can exit properly */ + if ((game_info.video & GameInfo::SDL1) || (game_info.video & GameInfo::SDL2)) { + pushNativeSDLEvents(); + } + + if (!(shared_config.debug_state & SharedConfig::DEBUG_NATIVE_EVENTS)) { + pushNativeXlibEvents(); + } + + return; + } /*** Update time ***/