Somewhat misleading documentation of GSourceFuncs
struct GSourceFuncs {
gboolean (*prepare) (GSource *source,
gint *timeout_);
gboolean (*check) (GSource *source);
gboolean (*dispatch) (GSource *source,
GSourceFunc callback,
gpointer user_data);
void (*finalize) (GSource *source); /* Can be NULL */
};
Notice that only finalize has a comment to indicate that it can be NULL. However, prepare and check can both be NULL too. Only dispatch is required.