hook->hook_id = 0;
hook->flags &= ~G_HOOK_FLAG_ACTIVE;
if (hook_list->hook_destroy)
- {
- hook_list->hook_destroy (hook_list, hook);
- hook->destroy = NULL;
- }
+ hook_list->hook_destroy (hook_list, hook);
else if (hook->destroy)
- {
- GDestroyNotify destroy;
-
- destroy = hook->destroy;
- hook->destroy = NULL;
- destroy (hook->data);
- }
+ hook->destroy (hook->data);
g_hook_unref (hook_list, hook); /* counterpart to g_hook_insert_before */
}
}
hook->hook_id = 0;
hook->flags &= ~G_HOOK_FLAG_ACTIVE;
if (hook_list->hook_destroy)
- {
- hook_list->hook_destroy (hook_list, hook);
- hook->destroy = NULL;
- }
+ hook_list->hook_destroy (hook_list, hook);
else if (hook->destroy)
- {
- GDestroyNotify destroy;
-
- destroy = hook->destroy;
- hook->destroy = NULL;
- destroy (hook->data);
- }
+ hook->destroy (hook->data);
g_hook_unref (hook_list, hook); /* counterpart to g_hook_insert_before */
}
}
G_LOCK (main_loop);
}
+static void
+g_source_noop (GHookList *hook_list,
+ GHook *hook)
+{
+}
+
guint
g_source_add (gint priority,
gboolean can_recurse,
if (!source_list.is_setup)
g_hook_list_init (&source_list, sizeof(GSource));
- source_list.hook_destroy = g_source_destroy_func;
+ source_list.hook_destroy = g_source_noop;
+ source_list.hook_free = g_source_destroy_func;
source = (GSource *)g_hook_alloc (&source_list);
source->priority = priority;
{
GTimeoutData *data = source_data;
- if (data->callback(user_data))
+ if (data->callback (user_data))
{
guint seconds = data->interval / 1000;
guint msecs = data->interval - seconds * 1000;
G_LOCK (main_loop);
}
+static void
+g_source_noop (GHookList *hook_list,
+ GHook *hook)
+{
+}
+
guint
g_source_add (gint priority,
gboolean can_recurse,
if (!source_list.is_setup)
g_hook_list_init (&source_list, sizeof(GSource));
- source_list.hook_destroy = g_source_destroy_func;
+ source_list.hook_destroy = g_source_noop;
+ source_list.hook_free = g_source_destroy_func;
source = (GSource *)g_hook_alloc (&source_list);
source->priority = priority;
{
GTimeoutData *data = source_data;
- if (data->callback(user_data))
+ if (data->callback (user_data))
{
guint seconds = data->interval / 1000;
guint msecs = data->interval - seconds * 1000;