X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FGUI%2FFGPUIMenuBar.cxx;h=5e1a31760e1e0e60af713551391833a04a64888e;hb=6dd47822545bf27f69a18a2d0ccc8abf91daa8d5;hp=98884b7d36d7fa8259d8b4a4b570f488ce0ba79a;hpb=f3502a760b35441cb99e424923d75b0495a83161;p=flightgear.git diff --git a/src/GUI/FGPUIMenuBar.cxx b/src/GUI/FGPUIMenuBar.cxx index 98884b7d3..5e1a31760 100644 --- a/src/GUI/FGPUIMenuBar.cxx +++ b/src/GUI/FGPUIMenuBar.cxx @@ -76,8 +76,6 @@ menu_callback (puObject * object) mb->fireItem(object); } - - //////////////////////////////////////////////////////////////////////// // Implementation of FGPUIMenuBar. //////////////////////////////////////////////////////////////////////// @@ -98,6 +96,8 @@ void FGPUIMenuBar::init () { delete _menuBar; // FIXME: check if PUI owns the pointer + _menuBar = NULL; + make_menubar(); // FIXME: temporary commands to get at // old, hard-coded dialogs. @@ -262,9 +262,12 @@ FGPUIMenuBar::destroy_menubar () // plib. SG_LOG(SG_GENERAL, SG_BULK, "Deleting char arrays"); for (i = 0; i < _char_arrays.size(); i++) { - for (int j = 0; _char_arrays[i][j] != 0; j++) + for (int j = 0; _char_arrays[i][j] != 0; j++) { free(_char_arrays[i][j]); // added with strdup + _char_arrays[i][j] = 0; + } delete[] _char_arrays[i]; + _char_arrays[i] = 0; } // Delete all the callback arrays