From 6f1b0b078386508e0f4074878ce800e56539e979 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Tue, 29 Oct 2019 12:13:51 -0230 Subject: [PATCH] Fix segfault on shutdown in certain cases (mostly if OSystem creation failed). --- src/emucore/OSystem.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index 356418c7d..b1b9997ba 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -243,13 +243,13 @@ void OSystem::loadConfig(const Settings::Options& options) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void OSystem::saveConfig() { - // Save the last windowed position and display on system shutdown - myFrameBuffer->updateWindowedPos(); - settings().setValue("display", myFrameBuffer->getCurrentDisplayIndex()); - // Ask all subsystems to save their settings if(myFrameBuffer) { + // Save the last windowed position and display on system shutdown + myFrameBuffer->updateWindowedPos(); + settings().setValue("display", myFrameBuffer->getCurrentDisplayIndex()); + Logger::debug("Saving TV effects options ..."); myFrameBuffer->tiaSurface().ntsc().saveConfig(settings()); }