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 void
FGPUIMenuBar::init () FGPUIMenuBar::init ()
{ {
delete _menuBar; // FIXME: check if PUI owns the pointer destroy_menubar();
_menuBar = NULL;
make_menubar(); make_menubar();
// FIXME: temporary commands to get at // FIXME: temporary commands to get at
@ -286,6 +285,10 @@ FGPUIMenuBar::destroy_menubar ()
delete it->second[i]; delete it->second[i];
} }
_menuBar = NULL;
_bindings.clear();
_char_arrays.clear();
_callback_arrays.clear();
SG_LOG(SG_GENERAL, SG_BULK, "Done."); SG_LOG(SG_GENERAL, SG_BULK, "Done.");
} }