Loading src/html.cpp +15 −15 Original line number Diff line number Diff line Loading @@ -646,30 +646,30 @@ libhtmlpp::HtmlElement::~HtmlElement(){ DELETEELEMENT: while(cur){ if(cur->getType()==HtmlEl){ if(((HtmlElement*)cur)->_childElement){ delelm.push(cur); if(cur->getType()==HtmlEl && ((HtmlElement*)cur)->_childElement){ parents.push((HtmlElement*)cur); cur=((HtmlElement*)cur)->_childElement; }else{ cur=cur->_nextElement; } } Element *next=cur->_nextElement; cur->_firstElement=nullptr; cur->_prevElement=nullptr; cur->_nextElement=nullptr; delelm.push(cur); cur=next; } if(!parents.empty()){ cur=parents.top(); ((HtmlElement*)cur)->_childElement=nullptr; cur=parents.top()->_nextElement; parents.pop(); goto DELETEELEMENT; } while(!delelm.empty()){ if(delelm.top()!=this) delete delelm.top(); Element *del=delelm.top(); del->_firstElement=nullptr; del->_prevElement=nullptr; del->_nextElement=nullptr; if(del!=this){ delete del; } delelm.pop(); }; Loading Loading
src/html.cpp +15 −15 Original line number Diff line number Diff line Loading @@ -646,30 +646,30 @@ libhtmlpp::HtmlElement::~HtmlElement(){ DELETEELEMENT: while(cur){ if(cur->getType()==HtmlEl){ if(((HtmlElement*)cur)->_childElement){ delelm.push(cur); if(cur->getType()==HtmlEl && ((HtmlElement*)cur)->_childElement){ parents.push((HtmlElement*)cur); cur=((HtmlElement*)cur)->_childElement; }else{ cur=cur->_nextElement; } } Element *next=cur->_nextElement; cur->_firstElement=nullptr; cur->_prevElement=nullptr; cur->_nextElement=nullptr; delelm.push(cur); cur=next; } if(!parents.empty()){ cur=parents.top(); ((HtmlElement*)cur)->_childElement=nullptr; cur=parents.top()->_nextElement; parents.pop(); goto DELETEELEMENT; } while(!delelm.empty()){ if(delelm.top()!=this) delete delelm.top(); Element *del=delelm.top(); del->_firstElement=nullptr; del->_prevElement=nullptr; del->_nextElement=nullptr; if(del!=this){ delete del; } delelm.pop(); }; Loading