diff options
Diffstat (limited to 'StarsEx/StarServer.cpp')
-rw-r--r-- | StarsEx/StarServer.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/StarsEx/StarServer.cpp b/StarsEx/StarServer.cpp index eea6784..7d6d8bc 100644 --- a/StarsEx/StarServer.cpp +++ b/StarsEx/StarServer.cpp @@ -65,9 +65,13 @@ static bool exit_latch = true; // +--------------------------------------------------------------------+ -StarServer::StarServer() -: loader(0), time_mark(0), minutes(0), -admin_server(0), lobby_server(0) +StarServer::StarServer() : + world {nullptr}, + loader(0), + time_mark(0), + minutes(0), + admin_server(0), + lobby_server(0) { if (instance != nullptr) throw "StarServer may have only one instance"; @@ -109,8 +113,8 @@ StarServer::~StarServer() // delete all the ships and stuff // BEFORE getting rid of the system // and weapons catalogs! - delete world; - world = 0; // don't let base class double delete the world + if (world) delete world; + world = nullptr; Drive::Close(); Explosion::Close(); |