fixed circular ref with setGeomNode, added warning for removeNode being called before cleanup
This commit is contained in:
parent
9d8ee1d2b3
commit
4acdfddc44
|
|
@ -177,7 +177,7 @@ class Actor(DirectObject, NodePath):
|
|||
# the root.
|
||||
root = PandaNode('actor')
|
||||
self.assign(NodePath(root))
|
||||
self.setGeomNode(self)
|
||||
self.setGeomNode(NodePath(self))
|
||||
|
||||
else:
|
||||
# A standard Actor has a ModelNode at the root, and
|
||||
|
|
@ -445,6 +445,11 @@ class Actor(DirectObject, NodePath):
|
|||
if not self.isEmpty():
|
||||
self.removeNode()
|
||||
|
||||
def removeNode(self):
|
||||
if self.__geomNode:
|
||||
self.notify.warning("called actor.removeNode() on %s without calling cleanup()" % self.getName())
|
||||
NodePath.removeNode(self)
|
||||
|
||||
def flush(self):
|
||||
"""
|
||||
Actor flush function
|
||||
|
|
|
|||
Loading…
Reference in New Issue