Fix event-context related assertion failure at exit
This fixes an assertion failure at exit which was caused by the event contexts being cleaned up before the dummy display. There is no need for the dummy display implementation to ever receive events so the functionality has been extended for it to not join an event context, resolving the assertion failure.
This commit is contained in:
parent
c514f31cff
commit
ea649ec0a2
4 changed files with 10 additions and 6 deletions
|
@ -149,7 +149,8 @@ void display::remove_single_overlay(const map_location& loc, const std::string&
|
|||
|
||||
|
||||
|
||||
display::display(const display_context * dc, CVideo& video, boost::weak_ptr<wb::manager> wb, reports & reports_object, const config& theme_cfg, const config& level) :
|
||||
display::display(const display_context * dc, CVideo& video, boost::weak_ptr<wb::manager> wb, reports & reports_object, const config& theme_cfg, const config& level, bool auto_join) :
|
||||
video2::draw_layering(auto_join),
|
||||
dc_(dc),
|
||||
halo_man_(new halo::manager(*this)),
|
||||
wb_(wb),
|
||||
|
|
|
@ -79,7 +79,7 @@ class display : public filter_context, public video2::draw_layering
|
|||
public:
|
||||
display(const display_context * dc, CVideo& video, boost::weak_ptr<wb::manager> wb,
|
||||
reports & reports_object,
|
||||
const config& theme_cfg, const config& level);
|
||||
const config& theme_cfg, const config& level, bool auto_join=true);
|
||||
virtual ~display();
|
||||
static display* get_singleton() { return singleton_ ;}
|
||||
|
||||
|
|
|
@ -72,8 +72,10 @@ std::vector<surface> footsteps_images(const map_location& loc, const pathfind::m
|
|||
game_display::game_display(game_board& board, CVideo& video, boost::weak_ptr<wb::manager> wb,
|
||||
reports & reports_object,
|
||||
const tod_manager& tod,
|
||||
const config& theme_cfg, const config& level) :
|
||||
display(&board, video, wb, reports_object, theme_cfg, level),
|
||||
const config& theme_cfg,
|
||||
const config& level,
|
||||
bool dummy) :
|
||||
display(&board, video, wb, reports_object, theme_cfg, level, !dummy),
|
||||
overlay_map_(),
|
||||
attack_indicator_src_(),
|
||||
attack_indicator_dst_(),
|
||||
|
@ -99,7 +101,7 @@ game_display* game_display::create_dummy_display(CVideo& video)
|
|||
static tod_manager dummy_tod(dummy_cfg);
|
||||
static reports rep_;
|
||||
return new game_display(dummy_board, video, boost::shared_ptr<wb::manager>(), rep_, dummy_tod,
|
||||
dummy_cfg, dummy_cfg);
|
||||
dummy_cfg, dummy_cfg, true);
|
||||
}
|
||||
|
||||
game_display::~game_display()
|
||||
|
|
|
@ -43,7 +43,8 @@ public:
|
|||
reports & reports_object,
|
||||
const tod_manager& tod_manager,
|
||||
const config& theme_cfg,
|
||||
const config& level);
|
||||
const config& level,
|
||||
bool dummy=false);
|
||||
|
||||
static game_display* create_dummy_display(CVideo& video);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue