set_dispose_function
Description:
Set dispose as dispose function on this.
The dispose function will be called once the reference count of this reaches zero but before any
of the state of the source is freed, especially before the finalize function (set as part of the [type@GLib.SourceFuncs]) is called.
This means that at this point this is still a valid [struct@GLib.Source] and it is allow for the reference
count to increase again until dispose returns.
The dispose function can be used to clear any ‘weak’ references to the this in other data structures in a thread-safe way where it is possible for another thread to increase the reference count of this again while it is being freed.
The finalize function can not be used for this purpose as at that point this is already partially freed and not valid any more.
This should only ever be called from [struct@GLib.Source] implementations.
Parameters:
| this |
a source to set the dispose function on |
| dispose |
dispose function to set on the source |