Skip to content

Commit

Permalink
Error fix DeleteChild
Browse files Browse the repository at this point in the history
Added call to Unlink in XMLNode::DeleteChild() so that references to
node are removed before memory is unallocated. This will ensure the
child is removed from parent and that no pointers are referring to the
unallocated memory. (Code is now aligned with the code in
XMLNode::DeleteChildren() )
  • Loading branch information
JarleStrand committed Dec 27, 2015
1 parent 9c8582c commit 81abfd6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tinyxml2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ void XMLNode::DeleteChild( XMLNode* node )
TIXMLASSERT( node );
TIXMLASSERT( node->_document == _document );
TIXMLASSERT( node->_parent == this );
Unlink( node );
DeleteNode( node );
}

Expand Down

0 comments on commit 81abfd6

Please sign in to comment.