From 9614f8ff74fc5d30f5d40b2f8817808164d21975 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 8 Apr 2015 10:06:06 +0300 Subject: [PATCH] More consistency asserts --- tinyxml2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 0619bdf..57b6ed9 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -662,6 +662,7 @@ void XMLNode::SetValue( const char* str, bool staticMem ) void XMLNode::DeleteChildren() { while( _firstChild ) { + TIXMLASSERT( _lastChild ); TIXMLASSERT( _firstChild->_document == _document ); XMLNode* node = _firstChild; Unlink( node ); @@ -676,6 +677,7 @@ void XMLNode::Unlink( XMLNode* child ) { TIXMLASSERT( child ); TIXMLASSERT( child->_document == _document ); + TIXMLASSERT( child->_parent == this ); if ( child == _firstChild ) { _firstChild = _firstChild->_next; }