From cd06896b2d931e0509bad4a1039ed2cabfe12629 Mon Sep 17 00:00:00 2001 From: Frederic Bouvier Date: Sun, 10 Jun 2012 22:25:58 +0200 Subject: [PATCH] Reset pointers in menus --- src/GUI/FGPUIMenuBar.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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