Fix segfault on shutdown in certain cases (mostly if OSystem creation failed).

This commit is contained in:
Stephen Anthony 2019-10-29 12:13:51 -02:30
parent 75bda25459
commit 6f1b0b0783
1 changed files with 4 additions and 4 deletions

View File

@ -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());
}