GNOME Bugzilla – Bug 635141
ShellTrayManager: fix icon actor memory management
Last modified: 2010-11-18 18:53:07 UTC
This fixes a crash we were seeing when status icons were removed; if you look at the patch it appears that any icon that has been ref-sinked - any actor passed into a Javascript signal handler - would get double unref'ed and cause a crash. While in fact, it was only hitting us for icon actors that are suppresed and not added to the stage. As far as I could establish in extensive investigation, this is because of: http://bugzilla.clutter-project.org/show_bug.cgi?id=2431 Which is causing almost all actors to leak if they are drawn at least once - so for most tray icons the leak and the extra unref cancelled.
Created attachment 174747 [details] [review] ShellTrayManager: fix icon actor memory management Becaue ShellTrayManager doesn't know if the ShellTrayIcon actors it creates will be added to a stage or not, it needs to adopt the initial floating reference count with g_object_ref_sink(). This avoids crashes when unref'ing the actor when the tray is removed. Thanks for Jon McCann for help in tracking this down. http://bugzilla.clutter-project.org/show_bug.cgi?id=2431
Comment on attachment 174747 [details] [review] ShellTrayManager: fix icon actor memory management patch looks good. Commit message needs work. You're describing why we need to use ref_sink instead of ref, when the real problem is that we weren't reffing it at all.
Pushed with a better commit message Attachment 174747 [details] pushed as 909f2e6 - ShellTrayManager: fix icon actor memory management