From ff7bcd4c9102ad0fffabd192e7003cb8834667d3 Mon Sep 17 00:00:00 2001 From: foudfou Date: Tue, 7 Aug 2012 22:34:02 +0200 Subject: [PATCH] destroy icons when shutting down IMStatusIcon --- src/modules/linux/FiretrayIMStatusIcon.jsm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/linux/FiretrayIMStatusIcon.jsm b/src/modules/linux/FiretrayIMStatusIcon.jsm index 14f5af4..26aa295 100644 --- a/src/modules/linux/FiretrayIMStatusIcon.jsm +++ b/src/modules/linux/FiretrayIMStatusIcon.jsm @@ -43,7 +43,7 @@ firetray.IMStatusIcon = { }, shutdown: function() { - gtk.gtk_status_icon_set_visible(this.trayIcon, false); + this.destroyIcons(); // FIXME: tryCloseLibs should be done by Handler only, submodules should // just pass the imported ctypes modules to it // firetray.Utils.tryCloseLibs([gobject, gio, gtk]); @@ -55,6 +55,14 @@ firetray.IMStatusIcon = { this.themedIcons[name] = gio.g_themed_icon_new(name); }, + destroyIcons: function() { + for (let name in this.themedIcons) { + let gicon = this.themedIcons[name]; + gicon = gobject.g_object_unref(gicon); + } + gobject.g_object_unref(this.trayIcon); + }, + setIconImageFromGIcon: function(gicon) { if (!firetray.IMStatusIcon.trayIcon || !gicon) F.ERROR("Icon missing");