[graph] parent root Attributes to the Node

Guarantee Python ownership on objects when using Qt backend. Otherwise, the ownership could be transferred to QML when getting objects via a Slot, leading to their destruction at gargabe collection.
This commit is contained in:
Yann Lanthony 2017-11-02 11:12:14 +01:00
parent d4376ca440
commit 95471e3e1b

View file

@ -477,11 +477,11 @@ class Node(BaseObject):
for attrDesc in self.nodeDesc.inputs:
assert isinstance(attrDesc, meshroom.core.desc.Attribute)
self._attributes.add(attribute_factory(attrDesc, None, False, self))
self._attributes.add(attribute_factory(attrDesc, None, False, self, self))
for attrDesc in self.nodeDesc.outputs:
assert isinstance(attrDesc, meshroom.core.desc.Attribute)
self._attributes.add(attribute_factory(attrDesc, None, True, self))
self._attributes.add(attribute_factory(attrDesc, None, True, self, self))
# List attributes per uid
for attr in self._attributes: