]> git.mxchange.org Git - flightgear.git/commitdiff
Reset pointers in menus
authorFrederic Bouvier <fredfgfs01@free.fr>
Sun, 10 Jun 2012 20:25:58 +0000 (22:25 +0200)
committerFrederic Bouvier <fredfgfs01@free.fr>
Sun, 10 Jun 2012 20:25:58 +0000 (22:25 +0200)
src/GUI/FGPUIMenuBar.cxx

index 98884b7d36d7fa8259d8b4a4b570f488ce0ba79a..0f62285a1e11c897d8fbe5957b0a587d5f33c6db 100644 (file)
@@ -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