fixed circular ref with setGeomNode, added warning for removeNode being called before cleanup

This commit is contained in:
Joe Shochet 2006-11-21 21:38:45 +00:00
parent 9d8ee1d2b3
commit 4acdfddc44
1 changed files with 6 additions and 1 deletions

View File

@ -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