diff options
-rw-r--r-- | starmath/inc/node.hxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index f4d90b9ada05..7479e3385503 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -266,12 +266,13 @@ public: { //Resize subnodes array maSubNodes.resize(nIndex + 1); - //Set new slots to NULL - for (size_t i = size; i < nIndex+1; i++) + //Set new slots to NULL except at nIndex + for (size_t i = size; i < nIndex; i++) maSubNodes[i] = nullptr; } maSubNodes[nIndex] = pNode; - ClaimPaternity(); + if (pNode) + pNode->SetParent(this); } private: |