diff --git a/src/GUI/dialog.cxx b/src/GUI/dialog.cxx index 5370e2a22..a2e2fb8e3 100644 --- a/src/GUI/dialog.cxx +++ b/src/GUI/dialog.cxx @@ -134,7 +134,7 @@ FGDialog::~FGDialog () for (i = 0; i < _char_arrays.size(); i++) { for (int j = 0; _char_arrays[i][j] != 0; j++) free(_char_arrays[i][j]); // added with strdup - delete _char_arrays[i]; + delete[] _char_arrays[i]; } // Delete all the info objects we diff --git a/src/GUI/menubar.cxx b/src/GUI/menubar.cxx index 0164dd2d8..82724b2bc 100644 --- a/src/GUI/menubar.cxx +++ b/src/GUI/menubar.cxx @@ -217,7 +217,7 @@ FGMenuBar::~FGMenuBar () for (i = 0; i < _char_arrays.size(); i++) { for (int j = 0; _char_arrays[i][j] != 0; j++) free(_char_arrays[i][j]); // added with strdup - delete _char_arrays[i]; + delete[] _char_arrays[i]; } // Delete all the callback arrays @@ -225,7 +225,7 @@ FGMenuBar::~FGMenuBar () // plib. SG_LOG(SG_GENERAL, SG_INFO, "Deleting callback arrays"); for (i = 0; i < _callback_arrays.size(); i++) - delete _callback_arrays[i]; + delete[] _callback_arrays[i]; // Delete all those bindings SG_LOG(SG_GENERAL, SG_INFO, "Deleting bindings");