From c2ca1d0057f4adaa98c0cfe1d84a87dfcbffa072 Mon Sep 17 00:00:00 2001 From: Vincent Pelletier Date: Sat, 10 Sep 2011 20:47:07 +0200 Subject: [PATCH] GRIM: Don't crash if no splash screen was used. --- engines/grim/grim.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engines/grim/grim.cpp b/engines/grim/grim.cpp index be8be7ad525..584d41580d8 100644 --- a/engines/grim/grim.cpp +++ b/engines/grim/grim.cpp @@ -486,7 +486,7 @@ Common::Error GrimEngine::run() { // refresh the theme engine so that we can show the gui overlay without it crashing. GUI::GuiManager::instance().theme()->refresh(); - Bitmap *splash_bm; + Bitmap *splash_bm = NULL; if (!(_gameFlags & ADGF_DEMO) && getGameType() == GType_GRIM) splash_bm = g_resourceloader->loadBitmap("splash.bm"); else if ((_gameFlags & ADGF_DEMO) && getGameType() == GType_MONKEY4) @@ -540,7 +540,8 @@ Common::Error GrimEngine::run() { } g_grim->setMode(ENGINE_MODE_NORMAL); - delete splash_bm; + if (splash_bm) + delete splash_bm; g_grim->mainLoop(); return Common::kNoError;