Skip to content

Commit

Permalink
catch exceptions in game_display, game_display::fake_unit dtor's
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Jun 8, 2014
1 parent f165a55 commit 4e7aa83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/game_display.cpp
Expand Up @@ -97,8 +97,10 @@ game_display* game_display::create_dummy_display(CVideo& video)

game_display::~game_display()
{
try {
// SDL_FreeSurface(minimap_);
prune_chat_messages(true);
} catch (...) {}
}

void game_display::new_turn()
Expand Down Expand Up @@ -667,10 +669,13 @@ game_display::fake_unit & game_display::fake_unit::operator=(unit const & a)
*/
game_display::fake_unit::~fake_unit()
{
try {
// The fake_unit class exists for this one line, which removes the
// fake_unit from the display's fake_units_ dequeue in the event of an
// exception.
if(my_display_){remove_from_game_display();}

} catch (...) {}
}

/**
Expand Down

0 comments on commit 4e7aa83

Please sign in to comment.