From: bcoconni Date: Sun, 24 Nov 2013 13:50:11 +0000 (+0100) Subject: Fixed a crash: the singleton needs to be instantiated the first time SGCommandMgr... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=01ace109bab7a458abd9c05717dd49ec1f0dfdf3;p=simgear.git Fixed a crash: the singleton needs to be instantiated the first time SGCommandMgr::instance() is called --- diff --git a/simgear/structure/commands.cxx b/simgear/structure/commands.cxx index 9a410936..752f880c 100644 --- a/simgear/structure/commands.cxx +++ b/simgear/structure/commands.cxx @@ -42,7 +42,7 @@ SGCommandMgr::~SGCommandMgr () SGCommandMgr* SGCommandMgr::instance() { - return static_instance; + return static_instance ? static_instance : new SGCommandMgr; } void