]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed memory leaks when parsing
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 1 Sep 2001 12:59:41 +0000 (12:59 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 1 Sep 2001 12:59:41 +0000 (12:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11536 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/htmlpars.cpp

index 57a7406d032463b5e827531475c00ff58fc023db..cf6897d33580cc372d237a006c45c7a7825f4f4c 100644 (file)
@@ -80,8 +80,9 @@ wxHtmlParser::wxHtmlParser()
 
 wxHtmlParser::~wxHtmlParser()
 {
-    while (RestoreState())
-        DestroyDOMTree();
+    while (RestoreState()) {}
+    DestroyDOMTree();
+    
     delete m_HandlersStack;
     m_HandlersHash.Clear();
     m_HandlersList.DeleteContents(TRUE);
@@ -386,6 +387,8 @@ bool wxHtmlParser::RestoreState()
 {
     if (!m_SavedStates) return FALSE;
 
+    DestroyDOMTree();
+
     wxHtmlParserState *s = m_SavedStates;
     m_SavedStates = s->m_nextState;