Fixed segfault when trying to start invalid gameid from command line.
svn-id: r31731
This commit is contained in:
parent
61101b6dce
commit
bba003e53a
2 changed files with 11 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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>() { }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue