After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 635141 - ShellTrayManager: fix icon actor memory management
ShellTrayManager: fix icon actor memory management
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-11-18 03:12 UTC by Owen Taylor
Modified: 2010-11-18 18:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ShellTrayManager: fix icon actor memory management (1.23 KB, patch)
2010-11-18 03:12 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2010-11-18 03:12:20 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.
Comment 1 Owen Taylor 2010-11-18 03:12:22 UTC
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 2 Dan Winship 2010-11-18 14:15:17 UTC
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.
Comment 3 Owen Taylor 2010-11-18 18:53:03 UTC
Pushed with a better commit message

Attachment 174747 [details] pushed as 909f2e6 - ShellTrayManager: fix icon actor memory management