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:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user