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()
{
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;