mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-06 21:50:05 +02:00
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:
13
glib/gmain.c
13
glib/gmain.c
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user