addToggleRef

open fun addToggleRef(notify: ToggleNotify)

Increases the reference count of the object by one and sets a callback to be called when all other references to the object are dropped, or when this is already the last reference to the object and another reference is established.

This functionality is intended for binding @object to a proxy object managed by another memory manager. This is done with two paired references: the strong reference added by g_object_add_toggle_ref() and a reverse reference to the proxy object which is either a strong reference or weak reference.

The setup is that when there are no other references to @object, only a weak reference is held in the reverse direction from @object to the proxy object, but when there are other references held to

Since

2.8

Parameters

notify

a function to call when this reference is the last reference to the object, or is no longer the last reference.