destroy


Description:

public void destroy ()

Removes a source from its [struct@GLib.

MainContext], if any, and marks it as destroyed.

The source cannot be subsequently added to another context. It is safe to call this on sources which have already been removed from their context.

This does not unref the [struct@GLib.Source]: if you still hold a reference, use [method@GLib.Source.unref] to drop it.

This function is safe to call from any thread, regardless of which thread the [struct@GLib.MainContext] is running in.

If the source is currently attached to a [struct@GLib.MainContext], destroying it will effectively unset the callback similar to calling [ method@GLib.Source.set_callback]. This can mean, that the data’s [callback@GLib.DestroyNotify] gets called right away.

Parameters:

this

a source