From: Frederic Bouvier Date: Sun, 10 Jun 2012 20:25:58 +0000 (+0200) Subject: Reset pointers in menus X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cd06896b2d931e0509bad4a1039ed2cabfe12629;p=flightgear.git Reset pointers in menus --- diff --git a/src/GUI/FGPUIMenuBar.cxx b/src/GUI/FGPUIMenuBar.cxx index 98884b7d3..0f62285a1 100644 --- a/src/GUI/FGPUIMenuBar.cxx +++ b/src/GUI/FGPUIMenuBar.cxx @@ -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