Fixed segfault when trying to start invalid gameid from command line.

svn-id: r31731
This commit is contained in:
Johannes Schickel 2008-04-26 10:21:53 +00:00
parent 61101b6dce
commit bba003e53a
2 changed files with 11 additions and 6 deletions

View file

@ -330,9 +330,9 @@ extern "C" int scummvm_main(int argc, char *argv[]) {
launcherDialog(system);
}
PluginManager::instance().unloadPluginsExcept(NULL);
PluginManager::instance().destroy();
ConfMan.destroy();
g_gui.destroy();
PluginManager::destroy();
Common::ConfigManager::destroy();
GUI::NewGui::destroy();
return 0;
}

View file

@ -57,6 +57,11 @@ public:
return new T();
}
static void destroyInstance() {
delete _singleton;
_singleton = 0;
}
public:
static T& instance() {
@ -71,9 +76,9 @@ public:
_singleton = T::makeInstance();
return *_singleton;
}
virtual void destroy() {
delete _singleton;
_singleton = 0;
static void destroy() {
T::destroyInstance();
}
protected:
Singleton<T>() { }