From c79bc15f5fd68ed9e143c537e53264f5ee77ca6d Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Wed, 10 Sep 2008 12:31:10 +0200 Subject: [PATCH] #8394 Destroy the palette when the invoker is dettached --- src/sugar/graphics/palette.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sugar/graphics/palette.py b/src/sugar/graphics/palette.py index 6360f4e1..8201cf86 100644 --- a/src/sugar/graphics/palette.py +++ b/src/sugar/graphics/palette.py @@ -277,7 +277,7 @@ class Palette(gtk.Window): def __menu_item_inserted_cb(self, menu): self._update_separators() - def __destroy_cb(self, palette): + def __destroy_cb(self, palette): self.set_group_id(None) def _add_menu(self): @@ -749,6 +749,9 @@ class Invoker(gobject.GObject): def detach(self): self.parent = None + if self._palette is not None: + self._palette.destroy() + self._palette = None def _get_position_for_alignment(self, alignment, palette_dim): palette_halign = alignment[0]