WeakRef.get

If weak_ref is not empty, atomically acquire a strong reference to the object it points to, and return that reference.

This function is needed because of the potential race between taking the pointer value and g_object_ref() on it, if the object was losing its last reference at the same time in a different thread.

The caller should release the resulting reference in the usual way, by using g_object_unref().

class WeakRef
get
()

Return Value

Type: ObjectG

the object pointed to by weak_ref, or NULL if it was empty

Meta

Since

2.32