[gnome-shell] ShellTrayManager: fix icon actor memory management
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] ShellTrayManager: fix icon actor memory management
- Date: Thu, 18 Nov 2010 18:52:53 +0000 (UTC)
commit 909f2e670a96c8c2956e0d928046fb5b8a9670b3
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Wed Nov 17 21:30:31 2010 -0500
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 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/shell-tray-manager.c b/src/shell-tray-manager.c
index 37368da..ec6c8ae 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]