From: ThorstenB Date: Sun, 24 Oct 2010 19:36:15 +0000 (+0200) Subject: Fix occasional start-up crash when reading GUI XMLs. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d61e992d765f0b7c59c74e8cb0d6004d5f2e596d;p=flightgear.git Fix occasional start-up crash when reading GUI XMLs. _dialog_props holds SGSharedPtrs (pointers managed by reference counters). Explicitly casting the object to an unmanaged SGPropertyNode* and deleting it may cause heap corruption, since the following assignment "_dialog_props[..] = ..." also tries to delete the (already deleted) object. --- diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index 034484e27..51bc82fc9 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -296,9 +296,6 @@ NewGUI::readDir (const char * path) continue; } string name = nameprop->getStringValue(); - if (_dialog_props[name]) - delete (SGPropertyNode *)_dialog_props[name]; - _dialog_props[name] = props; } }