add_weak_pointer


Description:

public void add_weak_pointer (void** weak_pointer_location)

Adds a weak reference from weak_pointer to this to indicate that the pointer located at weak_pointer_location is only valid during the lifetime of this.

When the this is finalized, weak_pointer will be set to null.

Note that as with weak_ref, the weak references created by this method are not thread-safe: they cannot safely be used in one thread if the object's last unref might happen in another thread. Use WeakRef if thread-safety is required.

Parameters:

this

The object that should be weak referenced.

weak_pointer_location

The memory address of a pointer.