[Scummvm-git-logs] scummvm master -> 87571811124b3b227924105fde6d0b172e5e94ea

criezy noreply at scummvm.org
Wed Sep 30 17:05:20 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
8757181112 ENGINES: Purge input events after deleting the engine


Commit: 87571811124b3b227924105fde6d0b172e5e94ea
    https://github.com/scummvm/scummvm/commit/87571811124b3b227924105fde6d0b172e5e94ea
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2026-09-30T18:00:33+01:00

Commit Message:
ENGINES: Purge input events after deleting the engine

This reverts commit 27ee364 that purged the events in the engine destructor
by polling events until the event queue is empty, but caused in some cases
the quit confirmation dialog to be shown during engine destruction, and a
crash. See bug #17188.

Instead we purge imputs events after the engine deletion using the dedicated
functions. We should maybe purge all events, as done before this commit, but
it would be better to have a dedicated function for this rather than poll
the events.

Changed paths:
    base/main.cpp
    engines/engine.cpp


diff --git a/base/main.cpp b/base/main.cpp
index ded510cde28..ef3997f1203 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -334,6 +334,10 @@ static Common::Error runGame(const Plugin *enginePlugin, OSystem &system, const
 	// Inform backend that the engine finished
 	system.engineDone();
 
+	// Purge queued input events that may remain from the engine (such as key-up)
+	system.getEventManager()->purgeKeyboardEvents();
+	system.getEventManager()->purgeMouseEvents();
+
 	// Clean up any game-specific keymaps
 	keymapper->cleanupGameKeymaps();
 
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 6d1e75c069f..8c55932db99 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -218,10 +218,6 @@ Engine::Engine(OSystem *syst)
 Engine::~Engine() {
 	_mixer->stopAll();
 
-	// Flush any pending remaining events
-	Common::Event evt;
-	while (g_system->getEventManager()->pollEvent(evt)) {}
-
 	delete _debugger;
 	delete _mainMenuDialog;
 	g_engine = NULL;




More information about the Scummvm-git-logs mailing list