From 60b62dd82f537209615e025e20a20f7542a6c171 Mon Sep 17 00:00:00 2001 From: Redmond Urbino Date: Fri, 2 Feb 2007 03:10:12 +0000 Subject: [PATCH] when destroying a gui object, properly destroy it's child gui objects --- direct/src/gui/DirectGuiBase.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/direct/src/gui/DirectGuiBase.py b/direct/src/gui/DirectGuiBase.py index 1bbf5cdc19..296547b139 100644 --- a/direct/src/gui/DirectGuiBase.py +++ b/direct/src/gui/DirectGuiBase.py @@ -1031,7 +1031,15 @@ class DirectGuiWidget(DirectGuiBase, NodePath): # Destroy children for child in self.getChildrenAsList(): childGui = self.guiDict.get(child.getName()) - if childGui: childGui.destroy() + if childGui: + childGui.destroy() + else: + # RAU since we added the class to the name, try + # it with the original name + parts = child.getName().split('-') + simpleChildGui = self.guiDict.get(parts[-1]) + if simpleChildGui: + simpleChildGui.destroy() # messenger.send(DESTROY + child.getName()) del self.guiDict[self.guiId] del self.frameStyle