Commit f5e1e169 authored by Benjamin Berg's avatar Benjamin Berg

binding: Clarify the use of g_object_unref() to remove a binding

Conceptually the binding is kept alive as long as both the source and
target exist. This means that an API user needs to take some care to
either hold a reference or only use a pointer to the binding as long as
also holding references to both objects.

Clarify the documentation a bit.
parent 290c9ee6
......@@ -799,9 +799,11 @@ g_binding_unbind (GBinding *binding)
* of bidirectional bindings, otherwise it will be ignored
* The binding will automatically be removed when either the @source or the
* @target instances are finalized. To remove the binding without affecting the
* @source and the @target you can just call g_object_unref() on the returned
* #GBinding instance.
* @target instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
* To remove the binding, call g_binding_unbind().
* A #GObject can have multiple bindings.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment