Skip to content

Commit

Permalink
Remove explicit destructor from playsingle_controller
Browse files Browse the repository at this point in the history
Now when the AI manager is part of game_state, destroying game_state
implicitly removes all observers from AI manager.
Therefore playsingle_controller no longer needs to explicitly deregister
itself as an observer.
  • Loading branch information
jyrkive committed Feb 20, 2018
1 parent 98a788e commit 1ab31bf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/playsingle_controller.cpp
Expand Up @@ -106,12 +106,6 @@ std::string playsingle_controller::describe_result() const
}
}

playsingle_controller::~playsingle_controller()
{
ai::manager::get_singleton().remove_observer(this);
ai::manager::get_singleton().clear_ais();
}

void playsingle_controller::init_gui()
{
LOG_NG << "Initializing GUI... " << (SDL_GetTicks() - ticks()) << "\n";
Expand Down
1 change: 0 additions & 1 deletion src/playsingle_controller.hpp
Expand Up @@ -36,7 +36,6 @@ class playsingle_controller : public play_controller
public:
playsingle_controller(const config& level, saved_game& state_of_game,
const config& game_config, const ter_data_cache & tdata, bool skip_replay);
virtual ~playsingle_controller();

LEVEL_RESULT play_scenario(const config& level);
void play_scenario_init();
Expand Down

0 comments on commit 1ab31bf

Please sign in to comment.