From: Václav Slavík Date: Wed, 29 Aug 2001 18:31:40 +0000 (+0000) Subject: fixed my favorite bug (delete foo; call foo->Something()) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d7b1d73c92067c3bad49cc19b2da514046c69f65?ds=sidebyside;hp=c556f19843b149bee5591f9f26254ebe4b0a2a8e fixed my favorite bug (delete foo; call foo->Something()) and non-recursive destructors as an add-on :) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11513 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/contrib/src/xrc/xmlres.cpp b/contrib/src/xrc/xmlres.cpp index c5f7a8c8ed..ef1e2f2761 100644 --- a/contrib/src/xrc/xmlres.cpp +++ b/contrib/src/xrc/xmlres.cpp @@ -245,14 +245,17 @@ static void ProcessPlatformProperty(wxXmlNode *node) } if (isok) + { ProcessPlatformProperty(c); + c = c->GetNext(); + } else { node->RemoveChild(c); + wxXmlNode *c2 = c->GetNext(); delete c; + c = c2; } - - c = c->GetNext(); } } diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index c5f7a8c8ed..ef1e2f2761 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -245,14 +245,17 @@ static void ProcessPlatformProperty(wxXmlNode *node) } if (isok) + { ProcessPlatformProperty(c); + c = c->GetNext(); + } else { node->RemoveChild(c); + wxXmlNode *c2 = c->GetNext(); delete c; + c = c2; } - - c = c->GetNext(); } }