Add a bunch of unrefs.

Thu Dec  7 15:22:30 2000  Owen Taylor  <otaylor@redhat.com>

	* tests/mainloop-test.c (recurser_start): Add a bunch
	of unrefs.

	* gmain.c (g_source_attach): Reference the source
	when adding (pointed out by Elliot)
This commit is contained in:
Owen Taylor
2000-12-07 20:29:58 +00:00
committed by Owen Taylor
parent e5c1f207c9
commit 1084477e03
3 changed files with 26 additions and 4 deletions

View File

@@ -752,6 +752,7 @@ g_source_attach (GSource *source,
source->context = context;
result = source->id = context->next_id++;
source->ref_count++;
g_source_list_add (source, context);
tmp_list = source->poll_fds;
@@ -2618,6 +2619,7 @@ g_timeout_add_full (gint priority,
GDestroyNotify notify)
{
GSource *source;
guint id;
g_return_val_if_fail (function != NULL, 0);
@@ -2627,7 +2629,10 @@ g_timeout_add_full (gint priority,
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;
}
/**
@@ -2731,6 +2736,7 @@ g_idle_add_full (gint priority,
GDestroyNotify notify)
{
GSource *source;
guint id;
g_return_val_if_fail (function != NULL, 0);
@@ -2740,7 +2746,10 @@ g_idle_add_full (gint priority,
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;
}
/**