source->context = context;
result = source->id = context->next_id++;
+ source->ref_count++;
g_source_list_add (source, context);
tmp_list = source->poll_fds;
GDestroyNotify notify)
{
GSource *source;
+ guint id;
g_return_val_if_fail (function != NULL, 0);
g_source_set_priority (source, priority);
g_source_set_callback (source, function, data, notify);
- return g_source_attach (source, NULL);
+ id = g_source_attach (source, NULL);
+ g_source_unref (source);
+
+ return id;
}
/**
GDestroyNotify notify)
{
GSource *source;
+ guint id;
g_return_val_if_fail (function != NULL, 0);
g_source_set_priority (source, priority);
g_source_set_callback (source, function, data, notify);
- return g_source_attach (source, NULL);
+ id = g_source_attach (source, NULL);
+ g_source_unref (source);
+
+ return id;
}
/**
source->context = context;
result = source->id = context->next_id++;
+ source->ref_count++;
g_source_list_add (source, context);
tmp_list = source->poll_fds;
GDestroyNotify notify)
{
GSource *source;
+ guint id;
g_return_val_if_fail (function != NULL, 0);
g_source_set_priority (source, priority);
g_source_set_callback (source, function, data, notify);
- return g_source_attach (source, NULL);
+ id = g_source_attach (source, NULL);
+ g_source_unref (source);
+
+ return id;
}
/**
GDestroyNotify notify)
{
GSource *source;
+ guint id;
g_return_val_if_fail (function != NULL, 0);
g_source_set_priority (source, priority);
g_source_set_callback (source, function, data, notify);
- return g_source_attach (source, NULL);
+ id = g_source_attach (source, NULL);
+ g_source_unref (source);
+
+ return id;
}
/**
adder_source = g_io_create_watch (channels[0], G_IO_IN | G_IO_HUP);
g_source_set_callback (adder_source, (GSourceFunc)adder_callback, &addr_data, NULL);
g_source_attach (adder_source, context);
+ g_source_unref (adder_source);
timeout_source = g_timeout_source_new (10);
g_source_set_callback (timeout_source, (GSourceFunc)timeout_callback, &addr_data, NULL);
g_source_set_priority (timeout_source, G_PRIORITY_HIGH);
g_source_attach (timeout_source, context);
+ g_source_unref (timeout_source);
g_main_run (addr_data.loop);
G_LOCK (context_array_lock);
g_source_attach (source, context_array->pdata[g_random_int_range (0, context_array->len)]);
+ g_source_unref (source);
G_UNLOCK (context_array_lock);
G_LOCK (crawler_array_lock);
source = g_idle_source_new ();
g_source_set_callback (source, recurser_idle, context, NULL);
g_source_attach (source, context);
+ g_source_unref (source);
G_UNLOCK (context_array_lock);
return TRUE;