ENGINES: Purge any remaining events when quitting an engine

This commit is contained in:
Paul Gilbert 2024-05-04 15:02:35 -07:00
parent 895c665654
commit 27ee3640af

View file

@ -198,6 +198,10 @@ 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;