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 657367 - GtkAction: Hold a reference to proxy widgets
GtkAction: Hold a reference to proxy widgets
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-08-25 18:55 UTC by Colin Walters
Modified: 2012-03-21 15:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkAction: Hold a reference to proxy widgets (1.43 KB, patch)
2011-08-25 18:55 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2011-08-25 18:55:49 UTC
Previously we expect that a proxy widget holds a reference to the
action via gtk_activatable_do_set_related_action().  However, it
is possible for the widget to still be in a floating state when
it adds itself to the the action.

This is a problem when gtk_action_get_proxies() gets called, because
we return floating objects back to the user.  And language bindings
aren't going to be expecting that.

Fix this by calling ref_sink() and unref().
Comment 1 Colin Walters 2011-08-25 18:55:51 UTC
Created attachment 194737 [details] [review]
GtkAction: Hold a reference to proxy widgets
Comment 2 Pavel Holejsovsky 2011-08-25 19:05:46 UTC
AFAICS there is also another partly related issue - private_data->proxies seem to leak when the action with proxies is destroyed.  However, I'm not sure whether all proxies aren't disconnected by some other means.
Comment 3 Pavel Holejsovsky 2011-08-26 03:15:39 UTC
Review of attachment 194737 [details] [review]:

::: gtk/gtkaction.c
@@ +728,3 @@
 
+  g_object_ref_sink (priv->gobj);
+

g_object_ref_sink (proxy) instead?
Comment 4 Matthias Clasen 2011-12-16 14:47:38 UTC
Review of attachment 194737 [details] [review]:

Setting patch status. Colin - any reply to the comment ?
Comment 5 Colin Walters 2011-12-20 20:37:31 UTC
Attachment 194737 [details] pushed as 06307dd - GtkAction: Hold a reference to proxy widgets
Comment 6 Colin Walters 2012-03-21 15:32:07 UTC
See also https://bugzilla.gnome.org/show_bug.cgi?id=672465