Scroll to navigation

TICKIT_REF(3) Library Functions Manual TICKIT_REF(3)

NAME

tickit_ref, tickit_unref - adjust the refcount of the toplevel instance

SYNOPSIS

#include <tickit.h>

Tickit *tickit_ref(Tickit *t);
void tickit_unref(Tickit *t);

Link with -ltickit.

DESCRIPTION

tickit_ref() increments the stored refcount of the given toplevel instance by one. It returns the pointer argument itself, so it is useful for chaining.

tickit_unref() decrements the stored refcount of the given toplevel instance by one. If the refcount drops to zero, the instance is destroyed. This will release any resources controlled by it and unbind all pending timer and later callbacks, causing them to be invoked with the TICKIT_EV_DESTROY flag if appropriate. This will also decrement refcount on the terminal and root window instances, which will likely cause them to be destroyed too.

RETURN VALUE

tickit_ref() returns a toplevel instance pointer. tickit_unref() returns no value.

SEE ALSO

tickit_new_stdio(3), tickit(7)