Browse Source

*** empty log message ***

Joe Shochet 25 years ago
parent
commit
79395a40df
1 changed files with 9 additions and 1 deletions
  1. 9 1
      direct/src/gui/OnscreenPanel.py

+ 9 - 1
direct/src/gui/OnscreenPanel.py

@@ -29,8 +29,11 @@ def cleanupPanel(uniqueName):
     """
         
     if OnscreenPanel.AllPanels.has_key(uniqueName):
+        # calling cleanup() will remove it out of the AllPanels dict
+        # This way it will get removed from the dict even it we did
+        # not clean it up using this interface (ie somebody called
+        # self.cleanup() directly
         OnscreenPanel.AllPanels[uniqueName].cleanup()
-        del OnscreenPanel.AllPanels[uniqueName]
 
 
 class OnscreenPanel(PandaObject.PandaObject, NodePath):
@@ -189,6 +192,11 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath):
         if not self.isEmpty():
             self.removeNode()
 
+        # Remove this panel out of the AllPanels list
+        uniqueName = self.getUniqueName()
+        if OnscreenPanel.AllPanels.has_key(uniqueName):
+            del OnscreenPanel.AllPanels[uniqueName]
+
         self.panelSetup = 0
         return 1