mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-08 18:36:17 +01:00
0319dac01d
g_object_bind_property() (transfer none) returns a GBinding with an existing internal reference which is active as long as the "binding" is. This allows to optionally use the binding without any memory management, as it will remove itself when it is no longer needed. There are currently three ways to remove the "binding" and as a result the reference: 1) Either the source or target dies and we get notified by a weakref callback 2) The user unrefs the binding until it is destroyed (which is semi-legal, but worked and is used in the test suite) 3) The user calls g_binding_unbind() In case (3) the problem was that it always calls unref even if the "binding" is already gone, leading to crashes when called from bindings multiple times. In #1373 and !197 it was noticed that a function always unrefs which would be a "transfer full" annotation, but the problem here is that it should only remove the ref when removing the "binding" and the annotation should stay "transfer none". As a side effect of this fix it is now also possible to call g_binding_unbind() multiple times where every call after the first is a no-op. This also adds explicit tests for case (1) and (3) - only case (3) is affected by this change. |
||
---|---|---|
.. | ||
.gitignore | ||
binding.c | ||
boxed.c | ||
closure.c | ||
dynamictests.c | ||
enums.c | ||
ifaceproperties.c | ||
Makefile.am | ||
marshalers.list | ||
meson.build | ||
mkenums.py | ||
object.c | ||
param.c | ||
private.c | ||
properties.c | ||
qdata.c | ||
reference.c | ||
signal-handler.c | ||
signals.c | ||
taptestrunner.py | ||
testcommon.h | ||
threadtests.c | ||
type.c | ||
value.c |