destroy icons when shutting down IMStatusIcon

This commit is contained in:
foudfou 2012-08-07 22:34:02 +02:00
parent ceba669bcd
commit ff7bcd4c91
1 changed files with 9 additions and 1 deletions

View File

@ -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");