Browse Source

Fix reference counting problem in pyVaultNode::AddNode().

This is fixed in H'uru via extensive use of RAII around vault nodes.
working_subtitles
Adam Johnson 3 years ago committed by rarified
parent
commit
31156794ad
  1. 3
      Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp

3
Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp

@ -441,7 +441,8 @@ PyObject* pyVaultNode::AddNode(pyVaultNode* pynode, PyObject* cbObject, UInt32 c
); );
if (newNode) { if (newNode) {
newNode->IncRef(); // No need to increment the newNode's reference count; the pynode
// will steal the current reference.
pynode->fNode->DecRef(); pynode->fNode->DecRef();
pynode->fNode = newNode; pynode->fNode = newNode;
} }

Loading…
Cancel
Save