1
0
Fork 0

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:
James Turner 2012-11-20 13:32:10 +00:00
parent d886f2a5f8
commit 04598859e3

View file

@ -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.");
}