Browse Source

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

Joe Shochet 19 years ago
parent
commit
4acdfddc44
1 changed files with 6 additions and 1 deletions
  1. 6 1
      direct/src/actor/Actor.py

+ 6 - 1
direct/src/actor/Actor.py

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