From a6d7d1521e8135d1e8ef45b4a630ee9219b4ad74 Mon Sep 17 00:00:00 2001 From: Chris Apers Date: Tue, 19 Aug 2003 15:03:27 +0000 Subject: Fix 1 memory leak + 102 memory leaks using launcher svn-id: r9783 --- common/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'common/main.cpp') diff --git a/common/main.cpp b/common/main.cpp index eab5f60f2a..725c544e60 100644 --- a/common/main.cpp +++ b/common/main.cpp @@ -200,10 +200,8 @@ int main(int argc, char *argv[]) { launcherDialog(detector, system); // Verify the given game name - if (detector.detectMain()) { - system->quit(); - return -1; - } + if (detector.detectMain()) + goto exitNow; // Set the window caption to the game name prop.caption = g_config->get("description", detector._gameFileName); @@ -217,7 +215,7 @@ int main(int argc, char *argv[]) { prop.gfx_mode = GFX_NORMAL; system->property(OSystem::PROP_SET_GFX_MODE, &prop); } - + // Create the game engine Engine *engine = Engine::createFromDetector(&detector, system); @@ -234,12 +232,14 @@ int main(int argc, char *argv[]) { // Free up memory delete engine; +exitNow: delete g_gui; delete g_config; // ...and quit (the return 0 should never be reached) system->quit(); - delete system; // palmos leaks + delete system; + free((void *)version_settings); // allocated in GameDetector return 0; } -- cgit v1.2.3