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 749352 - g_binding_unbind() fails when source is also the target
g_binding_unbind() fails when source is also the target
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gobject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-05-14 05:13 UTC by Garrett Regier
Modified: 2015-05-14 10:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix g_binding_unbind() when the source and target are the same (2.25 KB, patch)
2015-05-14 05:16 UTC, Garrett Regier
committed Details | Review

Description Garrett Regier 2015-05-14 05:13:53 UTC
Using g_binding_unbind() fails when the source object is also the target object, discovered while writing tests for EggBindingSet[1]. The issue is that g_binding_unbind() tries to remove a weak ref but that weak ref is only taken if the source and target objects are different[2].

1. https://git.gnome.org/browse/gnome-builder/tree/contrib/egg/egg-binding-set.c
2. https://git.gnome.org/browse/glib/tree/gobject/gbinding.c#n599
Comment 1 Garrett Regier 2015-05-14 05:16:16 UTC
Created attachment 303345 [details] [review]
Fix g_binding_unbind() when the source and target are the same

It tried to remove a weak ref, but it is only taken if the source and target object are different.
Comment 2 Christian Hergert 2015-05-14 05:26:42 UTC
Nice, thanks for finding this in EggBindingSet and for tracking it down in GBinding!

CC'ing ebassi for review though
Comment 3 Emmanuele Bassi (:ebassi) 2015-05-14 09:12:27 UTC
Review of attachment 303345 [details] [review]:

Looks good.
Comment 4 Garrett Regier 2015-05-14 10:59:53 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.