From 909f2e670a96c8c2956e0d928046fb5b8a9670b3 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 17 Nov 2010 21:30:31 -0500 Subject: [PATCH] ShellTrayManager: fix icon actor memory management We weren't actually referencing the ShellTrayIcon actors at all on creation, but would unreference them when they were removed, causing crashes. When we reference the actors, use g_object_ref_sink() so that memory management is consistent whether or not the actors are subsequently added to a parent actor. Thanks for Jon McCann for help in tracking this down. https://bugzilla.gnome.org/show_bug.cgi?id=635141 --- src/shell-tray-manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shell-tray-manager.c b/src/shell-tray-manager.c index 37368dab3..ec6c8aeee 100644 --- a/src/shell-tray-manager.c +++ b/src/shell-tray-manager.c @@ -264,6 +264,8 @@ on_plug_added (GtkSocket *socket, child = g_hash_table_lookup (manager->priv->icons, socket); child->actor = shell_tray_icon_new (SHELL_EMBEDDED_WINDOW (child->window)); + g_object_ref_sink (child->actor); + g_signal_emit (manager, shell_tray_manager_signals[TRAY_ICON_ADDED], 0, child->actor); }