From 81abfd6d4c02a46bae1542c22fe43658b7facb2a Mon Sep 17 00:00:00 2001 From: Jarle Strand Date: Sun, 27 Dec 2015 17:30:04 +0100 Subject: [PATCH] Error fix DeleteChild 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() ) --- tinyxml2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 510fc82..c4ea7cd 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -776,6 +776,7 @@ void XMLNode::DeleteChild( XMLNode* node ) TIXMLASSERT( node ); TIXMLASSERT( node->_document == _document ); TIXMLASSERT( node->_parent == this ); + Unlink( node ); DeleteNode( node ); }