Browse Source

*** empty log message ***

Joe Shochet 24 years ago
parent
commit
ccec42740b

+ 14 - 9
direct/src/actor/Actor.py

@@ -85,6 +85,8 @@ class Actor(PandaObject, NodePath):
         self.__partBundleDict = {}
         self.__animControlDict = {}
 
+        self.__LODNode = None
+
         if (other == None):
             # act like a normal contructor
 
@@ -92,7 +94,6 @@ class Actor(PandaObject, NodePath):
             self.gotName = 0
             self.assign(hidden.attachNewNode('actor'))
             self.setGeomNode(self.attachNewNode('actorGeom'))
-            self.__LODNode = None
             self.__hasLOD = 0
             
             # load models
@@ -282,14 +283,16 @@ class Actor(PandaObject, NodePath):
         Actor cleanup function
         """
         self.stop()
-        self.__partBundleDict = None
-        self.__animControlDict = None
-        self.__geomNode = None
-        self.__LODNode = None
+        del self.__partBundleDict
+        del self.__animControlDict
+        self.__geomNode.removeNode()
+        del self.__geomNode
+        if self.__LODNode:
+            self.__LODNode.removeNode()
+        del self.__LODNode
         self.__hasLOD = 0
         if not self.isEmpty():
             self.removeNode()
-        
     # accessing
 
     def getAnimControlDict(self):
@@ -1093,10 +1096,12 @@ class Actor(PandaObject, NodePath):
                 
             if (lodName!="lodRoot"):
                 # instance to appropriate node under LOD switch
-                bundle = bundle.instanceTo(
-                    self.__LODNode.find("**/" + str(lodName)))
+                #bundle = bundle.instanceTo(
+                #    self.__LODNode.find("**/" + str(lodName)))
+                bundle.reparentTo(self.__LODNode.find("**/" + str(lodName)))
             else:
-                bundle = bundle.instanceTo(self.__geomNode)
+                #bundle = bundle.instanceTo(self.__geomNode)
+                bundle.reparentTo(self.__geomNode)
 
             if (needsDict):
                 bundleDict[partName] = bundle

+ 3 - 0
direct/src/distributed/DistributedNodeAI.py

@@ -6,6 +6,9 @@ class DistributedNodeAI(DistributedObjectAI.DistributedObjectAI):
     def __init__(self, air):
         DistributedObjectAI.DistributedObjectAI.__init__(self, air)
 
+    def delete(self):
+        DistributedObjectAI.DistributedObjectAI.delete(self)
+
     ### setParent ###
 
     def d_setParent(self, parentString):

+ 7 - 7
direct/src/distributed/DistributedObject.py

@@ -36,13 +36,13 @@ class DistributedObject(PandaObject):
             self.deleteImminent = 0
         return None
 
-#    def __del__(self):
-#        """
-#        For debugging purposes, this just prints out what got deleted
-#        """
-#        DistributedObject.notify.debug("Destructing: " + self.__class__.__name__ +
-#                                       " id: " + str(self.doId))
-#        PandaObject.__del__(self)
+    #def __del__(self):
+    #    """
+    #    For debugging purposes, this just prints out what got deleted
+    #    """
+    #    DistributedObject.notify.debug("Destructing: " + self.__class__.__name__ +
+    #                                   " id: " + str(self.doId))
+    #    PandaObject.__del__(self)
 
     def setNeverDisable(self, bool):
         assert((bool == 1) or (bool == 0))

+ 10 - 9
direct/src/gui/DirectGuiBase.py

@@ -148,11 +148,6 @@ class DirectGuiBase(PandaObject.PandaObject):
         # no components with this group have been created.
         # self._dynamicGroups = ()
 
-    # Looks like they are being deleted, add this back in if
-    # we need to check again
-    #def __del__(self):
-    #    print 'Bye'
-
     def defineoptions(self, keywords, optionDefs, dynamicGroups = ()):
         """ defineoptions(keywords, optionDefs, dynamicGroups = {}) """
         # Create options, providing the default value and the method
@@ -613,7 +608,8 @@ class DirectGuiBase(PandaObject.PandaObject):
         del(self._optionInfo)
         del(self._hookDict)
         del(self.__componentInfo)
-
+        del self.postInitialiseFuncList
+        
     def bind(self, event, command, extraArgs = []):
         """
         Bind the command (which should expect one arg) to the specified
@@ -935,11 +931,16 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
         # Destroy children
         for child in self.getChildrenAsList():
             messenger.send(DESTROY + child.getName())
-        # Call superclass destruction method (clears out hooks)
-        DirectGuiBase.destroy(self)
+        del self.frameStyle
         # Get rid of node path
         self.removeNode()
-
+        for nodePath in self.stateNodePath:
+            nodePath.removeNode()
+        del self.stateNodePath
+        del self.guiItem
+        # Call superclass destruction method (clears out hooks)
+        DirectGuiBase.destroy(self)
+        
     def printConfig(self, indent = 0):
         space = ' ' * indent
         print space + self.guiId

+ 4 - 4
direct/src/gui/DirectWaitBar.py

@@ -38,16 +38,16 @@ class DirectWaitBar(DirectFrame):
             textoptiondefs = ()
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs + textoptiondefs)
-
         # Initialize superclasses
         DirectFrame.__init__(self, parent)
-
         self.barStyle = PGFrameStyle()
-
         # Call option initialization functions
         self.initialiseoptions(DirectWaitBar)
-
         self.updateBarStyle()
+
+    def destroy(self):
+        del self.barStyle
+        DirectFrame.destroy(self)
         
     def setRange(self):
         self.guiItem.setRange(self['range'])