From 4d7ca74c55edff30e34df1c36824a128211bfeb8 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 6 Apr 2022 21:35:26 +0200 Subject: Moved world ownership to concrete game classes --- StarsEx/Starshatter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'StarsEx/Starshatter.cpp') 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; -- cgit v1.1