mb->fireItem(object);
}
-
-\f
////////////////////////////////////////////////////////////////////////
// Implementation of FGPUIMenuBar.
////////////////////////////////////////////////////////////////////////
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.
// 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