diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 9ef7bc4..b181b67 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -760,11 +760,7 @@ void XMLNode::DeleteChildren() { while( _firstChild ) { TIXMLASSERT( _lastChild ); - TIXMLASSERT( _firstChild->_document == _document ); - XMLNode* node = _firstChild; - Unlink( node ); - - DeleteNode( node ); + DeleteChild( _firstChild ); } _firstChild = _lastChild = 0; }