diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-01-09 20:21:06 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-01-09 20:21:06 (GMT) |
commit | 83353f3c72684f493063246cb7b272d7eeca029f (patch) | |
tree | 65ced586e3a06eed0c3f01a94efd9b5a91d16b91 /lib/sugar/graphics/palette.py | |
parent | 86b943b2445f42ee42ee07d3258abe695739e65e (diff) |
#5532: Fix memory leak when a buddy disappears.
Diffstat (limited to 'lib/sugar/graphics/palette.py')
-rw-r--r-- | lib/sugar/graphics/palette.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sugar/graphics/palette.py b/lib/sugar/graphics/palette.py index a4cef8f..a24a806 100644 --- a/lib/sugar/graphics/palette.py +++ b/lib/sugar/graphics/palette.py @@ -148,6 +148,7 @@ class Palette(gtk.Window): # Just assume xthickness and ythickness are the same self.set_border_width(self.style.xthickness) self.connect('realize', self._realize_cb) + self.connect('destroy', self.__destroy_cb) self.palette_state = self.PRIMARY @@ -217,6 +218,12 @@ class Palette(gtk.Window): self._mouse_detector = MouseSpeedDetector(self, 200, 5) self._mouse_detector.connect('motion-slow', self._mouse_slow_cb) + def __destroy_cb(self, palette): + self.set_group_id(None) + + if self._palette_popup_sid is not None: + _palette_observer.disconnect(self._palette_popup_sid) + def _add_menu(self): self._menu_box = gtk.VBox() self._secondary_box.pack_start(self._menu_box) |