diff --git a/src/common/game_state/game_state.cpp b/src/common/game_state/game_state.cpp index 238f27752152738e1be9d9a63eaf934f00f62c4e..8af9809ae6d27e3e41943ab7f4e1c67422ca0810 100644 --- a/src/common/game_state/game_state.cpp +++ b/src/common/game_state/game_state.cpp @@ -70,10 +70,12 @@ game_state::game_state() : unique_serializable() { // destructor game_state::~game_state() { + /* for (auto & player : _players) { delete player; player = nullptr; } + */ delete _deck; delete _trick; @@ -88,6 +90,21 @@ game_state::~game_state() { delete _current_player_idx; delete _trump_color; delete _trick_estimate_sum; + + _deck = nullptr; + _trick = nullptr; + + _is_started = nullptr; + _is_finished = nullptr; + _is_estimation_phase = nullptr; + + _round_number = nullptr; + _trick_number = nullptr; + _starting_player_idx = nullptr; + _trick_starting_player_idx = nullptr; + _current_player_idx = nullptr; + _trump_color = nullptr; + _trick_estimate_sum = nullptr; } // accessors