]> git.mxchange.org Git - flightgear.git/commitdiff
Fix occasional start-up crash when reading GUI XMLs.
authorThorstenB <brehmt@gmail.com>
Sun, 24 Oct 2010 19:36:15 +0000 (21:36 +0200)
committerThorstenB <brehmt@gmail.com>
Sun, 24 Oct 2010 19:36:15 +0000 (21:36 +0200)
_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.

src/GUI/new_gui.cxx

index 034484e27d106a9d686f5802f274f20f571edbc8..51bc82fc9278fd16db8bc77f02e6def9ac0f38e7 100644 (file)
@@ -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;
         }
     }