[glibmm/wip/dboles/Binding-Issue#62: 1/2] Binding: Clarify need to hold ref, poss empty objs



commit e6af3b721f121b34f320cf7923d49545fc6bf272
Author: Daniel Boles <dboles src gmail com>
Date:   Fri Nov 15 11:08:24 2019 +0000

    Binding: Clarify need to hold ref, poss empty objs
    
    https://gitlab.gnome.org/GNOME/glibmm/issues/62

 glib/src/binding.hg | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/glib/src/binding.hg b/glib/src/binding.hg
index ff1df062..b9baf4fc 100644
--- a/glib/src/binding.hg
+++ b/glib/src/binding.hg
@@ -138,9 +138,13 @@ public:
    * will be updated as well. The @a transform_from function is only used in case
    * of bidirectional bindings, otherwise it will be ignored.
    *
-   * The binding will automatically be removed when either the source or the
-   * target instance is deleted. To remove the binding without affecting the
-   * source and the target you can call unbind() on the returned Binding instance.
+   * The binding between the properties is broken when the Glib::Binding loses
+   * its last Glib::RefPtr, either source/target Glib::ObjectBase is deleted,
+   * or unbind() is called. If a Glib::RefPtr to the Glib::Binding remains
+   * after the binding is broken another way, then get_source() and get_target()
+   * return an empty Glib::RefPtr. So, you must keep a Glib::RefPtr to the
+   * Glib::Binding for as long as you want to bind, but that alone does not
+   * necessarily mean the binding between properties itself is still active.
    *
    * A Glib::ObjectBase instance can have multiple bindings.
    *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]