Avoid crash if strict mode is enabled, console is reloaded and linking fails.

This commit is contained in:
Christian Speckner 2024-08-21 23:09:32 +02:00
parent 53d239c7e5
commit 7644ba6fa8
2 changed files with 4 additions and 1 deletions

View File

@ -1518,7 +1518,9 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
return; return;
case Event::ReloadConsole: case Event::ReloadConsole:
if(pressed && !repeated) myOSystem.reloadConsole(true); if(pressed && !repeated && !myOSystem.reloadConsole(true))
setState(EventHandlerState::LAUNCHER);
return; return;
case Event::PreviousMultiCartRom: case Event::PreviousMultiCartRom:

View File

@ -967,6 +967,7 @@ void OSystem::mainLoop()
const bool wasEmulation = myEventHandler->state() == EventHandlerState::EMULATION; const bool wasEmulation = myEventHandler->state() == EventHandlerState::EMULATION;
myEventHandler->poll(TimerManager::getTicks()); myEventHandler->poll(TimerManager::getTicks());
if(myQuitLoop) break; // Exit if the user wants to quit if(myQuitLoop) break; // Exit if the user wants to quit
if (!wasEmulation && myEventHandler->state() == EventHandlerState::EMULATION) { if (!wasEmulation && myEventHandler->state() == EventHandlerState::EMULATION) {