瀏覽代碼

add comment

Lee Thomason 1 周之前
父節點
當前提交
682fda289f
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      tinyxml2.cpp

+ 3 - 0
tinyxml2.cpp

@@ -834,6 +834,9 @@ 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;