diff --git a/src/common/FrameBufferSDL2.cxx b/src/common/FrameBufferSDL2.cxx index 8ab38cbda..74d017c75 100644 --- a/src/common/FrameBufferSDL2.cxx +++ b/src/common/FrameBufferSDL2.cxx @@ -47,7 +47,7 @@ FrameBufferSDL2::FrameBufferSDL2(OSystem& osystem) ostringstream buf; buf << "ERROR: Couldn't initialize SDL: " << SDL_GetError() << endl; myOSystem.logMessage(buf.str(), 0); - return; + throw "FATAL ERROR"; } myOSystem.logMessage("FrameBufferSDL2::FrameBufferSDL2 SDL_Init()", 2); diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index 6d16c7c1b..921340637 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -120,7 +120,8 @@ bool OSystem::create() // Get relevant information about the video hardware // This must be done before any graphics context is created, since // it may be needed to initialize the size of graphical objects - myFrameBuffer = MediaFactory::createVideo(*this); + try { myFrameBuffer = MediaFactory::createVideo(*this); } + catch(...) { return false; } if(!myFrameBuffer->initialize()) return false; @@ -174,9 +175,11 @@ void OSystem::loadConfig() void OSystem::saveConfig() { // Ask all subsystems to save their settings - myFrameBuffer->tiaSurface().ntsc().saveConfig(*mySettings); + if(myFrameBuffer) + myFrameBuffer->tiaSurface().ntsc().saveConfig(*mySettings); - mySettings->saveConfig(); + if(mySettings) + mySettings->saveConfig(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -