static void handle_object_finalized (gpointer data, GObject *where_the_object_was) { TimeoutData *td = data; gsk_source_remove (td->source); if (td->destroy) td->destroy(td->data); g_free (td); }
static gboolean handle_timeout (gpointer data) { TimeoutData *td = data; g_object_weak_unref (td->object, handle_object_finalized, data); if (td->func) td->func (td->object, td->data); else g_error ("object %p [%s] exceeded allowed lifetime [data=%p]", G_OBJECT (td->object), G_OBJECT_TYPE_NAME (td->object), td->data); if (td->destroy) td->destroy(td->data); g_free (td); return FALSE; }