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