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 738147 - StWidget: carefully clear ->accessible pointer to avoid resurrection
StWidget: carefully clear ->accessible pointer to avoid resurrection
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: 2014-10-08 12:24 UTC by Owen Taylor
Modified: 2014-10-13 16:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
StWidget: carefully clear ->accessible pointer to avoid resurrection (2.53 KB, patch)
2014-10-08 12:24 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2014-10-08 12:24:21 UTC
The pointer to ->accessible was cleared too early in dispose, which
resulted in another accessible object being created when the actor
was removed from its parent in clutter_actor_dispose(). Use a
weak reference instead to clear the ->accessible pointer.
Comment 1 Owen Taylor 2014-10-08 12:24:24 UTC
Created attachment 288038 [details] [review]
StWidget: carefully clear ->accessible pointer to avoid resurrection
Comment 2 Rui Matos 2014-10-08 13:18:15 UTC
Review of attachment 288038 [details] [review]:

::: src/st/st-widget.c
@@ +2539,3 @@
+          g_object_unref (widget->priv->accessible);
+          widget->priv->accessible = NULL;
+        }

Doesn't this mean that if someone sets a custom accessible and then sets another, different, custom one, we'd try to remove a weak pointer that we never added?

@@ +2543,2 @@
       if (accessible)
         widget->priv->accessible =  g_object_ref (accessible);

i.e. I think we should add a weak pointer here too
Comment 3 Owen Taylor 2014-10-13 16:47:45 UTC
Pushed with the added weakref. Thanks for the review, Rui.

Attachment 288038 [details] pushed as 5e5035a - StWidget: carefully clear ->accessible pointer to avoid resurrection