Make PUI menu-bar reinit safe.
Was only cleaning up the PUI menubar, not old bindings / names. This led to duplicate bindings, each time the GUI was reset, which can happen for various reasons.
This commit is contained in:
parent
d886f2a5f8
commit
04598859e3
1 changed files with 7 additions and 4 deletions
|
@ -95,8 +95,7 @@ FGPUIMenuBar::~FGPUIMenuBar ()
|
|||
void
|
||||
FGPUIMenuBar::init ()
|
||||
{
|
||||
delete _menuBar; // FIXME: check if PUI owns the pointer
|
||||
_menuBar = NULL;
|
||||
destroy_menubar();
|
||||
|
||||
make_menubar();
|
||||
// FIXME: temporary commands to get at
|
||||
|
@ -286,6 +285,10 @@ FGPUIMenuBar::destroy_menubar ()
|
|||
delete it->second[i];
|
||||
}
|
||||
|
||||
_menuBar = NULL;
|
||||
_bindings.clear();
|
||||
_char_arrays.clear();
|
||||
_callback_arrays.clear();
|
||||
SG_LOG(SG_GENERAL, SG_BULK, "Done.");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue