fixed memory leaks when parsing

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11536 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2001-09-01 12:59:41 +00:00
parent 06069dda0d
commit 0beefa20dc

View File

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