1
0
mirror of https://github.com/leethomason/tinyxml2.git synced 2026-07-25 21:23:00 +04:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Lee Thomason 063d313b7f fix merge 2026-03-09 18:04:02 -07:00
2 changed files with 10 additions and 11 deletions
+2 -11
View File
@@ -834,17 +834,7 @@ XMLNode::XMLNode( XMLDocument* doc ) :
XMLNode::~XMLNode()
{
// Fast path: this node is dying, so maintaining _firstChild/_lastChild and
// sibling _prev/_next links is unnecessary. Only _parent must be zeroed to
// satisfy the MarkInUse assertion inside DeleteNode.
XMLNode *currentChild = _firstChild;
while (currentChild != NULL) {
XMLNode *next = currentChild->_next;
currentChild->_parent = 0;
DeleteNode(currentChild);
currentChild = next;
}
DeleteChildren();
if ( _parent ) {
_parent->Unlink( this );
}
@@ -2361,6 +2351,7 @@ void XMLDocument::DeleteNode( XMLNode* node ) {
if(node == 0) {
return; // check for null pointer
}
TIXMLASSERT(node->_document == this);
if (node->_parent) {
node->_parent->DeleteChild( node );
}
+8
View File
@@ -42,6 +42,14 @@ distribution.
#endif
#include <stdint.h>
/*
gcc:
g++ -Wall -DTINYXML2_DEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe
Formatting, Artistic Style:
AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h
*/
#if defined( _DEBUG ) || defined (__DEBUG__)
# ifndef TINYXML2_DEBUG
# define TINYXML2_DEBUG