summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/Starshatter.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-06 21:35:26 +0200
committerAki <please@ignore.pl>2022-04-06 21:53:53 +0200
commit4d7ca74c55edff30e34df1c36824a128211bfeb8 (patch)
tree807e794e2f85cfb3a817a6bd2e3158b7899b48b9 /StarsEx/Starshatter.cpp
parent947910fc3c541ffdab3b042cfa3a3926b64f0ba3 (diff)
downloadstarshatter-4d7ca74c55edff30e34df1c36824a128211bfeb8.zip
starshatter-4d7ca74c55edff30e34df1c36824a128211bfeb8.tar.gz
starshatter-4d7ca74c55edff30e34df1c36824a128211bfeb8.tar.bz2
Moved world ownership to concrete game classes
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;