Skip to content

Commit

Permalink
fix a stack corruption
Browse files Browse the repository at this point in the history
Gui 2 dialogs set the value passed to register_integer to the widgets
value when the dialog is closed. So they must live linger than the
dialog. In thise case a local variable of the dialogs constructor was
passed to register_integer which caused a stack corruption.
  • Loading branch information
gfgtdf committed Jun 4, 2015
1 parent 04c8aac commit f16dec9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/dialogs/editor/editor_edit_side.cpp
Expand Up @@ -62,7 +62,7 @@ teditor_edit_side::teditor_edit_side(int side,
bool& shroud,
bool& share_maps,
team::CONTROLLER& controller,
int controller_num,
int /*controller_num*/,
bool& no_leader,
bool& hidden)
: controller_(controller)
Expand All @@ -80,7 +80,8 @@ teditor_edit_side::teditor_edit_side(int side,
register_integer("village_income", true, village_income);
register_integer("village_support", true, village_support);

register_integer("controller_number_player", true, controller_num);
//The following line is outommented becasue it causes crashs.
//register_integer("controller_number_player", true, controller_num);

register_bool("fog", true, fog);
register_bool("share_view", true, share_view);
Expand Down

0 comments on commit f16dec9

Please sign in to comment.