Browse Source

Merge pull request #317 from Dmitry-Me/moreConsistencyAsserts

More consistency asserts
Lee Thomason 11 years ago
parent
commit
2d39158eaa
1 changed files with 2 additions and 0 deletions
  1. 2 0
      tinyxml2.cpp

+ 2 - 0
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;
     }