The bt_object class' bt_object_set_parent() increments the reference
count of the parent since the child now holds a reference to it.
This assumes that a child is externally visible when this call is
made (as is always the case currently).
The parent of a child can be changed in the future. In this case,
we want to ensure the reference it held to its former parent is
released.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
* to the parent will be released once the object's reference count
* falls to zero.
*/
+ BT_PUT(child->parent);
child->parent = bt_get(parent);
}