summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/Starshatter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'StarsEx/Starshatter.cpp')
-rw-r--r--StarsEx/Starshatter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/StarsEx/Starshatter.cpp b/StarsEx/Starshatter.cpp
index 23ba839..5121d33 100644
--- a/StarsEx/Starshatter.cpp
+++ b/StarsEx/Starshatter.cpp
@@ -144,7 +144,7 @@ enum CHAT_MODES {
// +--------------------------------------------------------------------+
Starshatter::Starshatter()
-: gamewin(0), menuscreen(0), loadscreen(0), planscreen(0),
+: world{nullptr}, gamewin(0), menuscreen(0), loadscreen(0), planscreen(0),
cmpnscreen(0), gamescreen(0), splash(0), splash_index(0),
input(0), loader(0), cam_dir(0), music_dir(0),
field_of_view(2), time_mark(0), minutes(0),
@@ -264,8 +264,8 @@ Starshatter::~Starshatter()
// 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;
delete quick_mission;