summaryrefslogtreecommitdiff
path: root/gmain.c
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>1998-12-21 21:43:00 +0000
committerTim Janik <timj@src.gnome.org>1998-12-21 21:43:00 +0000
commit097c9b17985efe03bf7d5a1b073d81f526218c87 (patch)
treec74e266ccd11d53c49c934a7d7876f27f97dcc2f /gmain.c
parent85755f7e77f5283cc13d2e8f7d841d2e151bfc33 (diff)
downloadglib-097c9b17985efe03bf7d5a1b073d81f526218c87.tar.gz
there was a reference count race for hooks during invocation loops. since
Mon Dec 21 21:48:29 1998 Tim Janik <timj@gtk.org> * glib.h: * gmain.c: there was a reference count race for hooks during invocation loops. since all (known) hook loop implementations, do currently start out with g_hook_first_valid() and iterate with g_hook_next_valid(), g_hook_first_valid() will now return a referenced hook, and g_hook_next_valid() will "eat" that, and eventually transfer it to the next hook. <sigh> unfortunately this requires g_hook_next_valid() to take the hook_list as additional argument. * gmain.c (g_main_iterate): adjusted callers of g_hook_next_valid().
Diffstat (limited to 'gmain.c')
-rw-r--r--gmain.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gmain.c b/gmain.c
index 360821d48..2a5e25a8d 100644
--- a/gmain.c
+++ b/gmain.c
@@ -474,7 +474,7 @@ g_main_iterate (gboolean block,
break;
if (G_HOOK_IN_CALL (hook) && !(hook->flags & G_SOURCE_CAN_RECURSE))
{
- hook = g_hook_next_valid (hook, TRUE);
+ hook = g_hook_next_valid (&source_list, hook, TRUE);
continue;
}
@@ -510,7 +510,7 @@ g_main_iterate (gboolean block,
timeout = MIN (timeout, source_timeout);
}
- tmp = g_hook_next_valid (hook, TRUE);
+ tmp = g_hook_next_valid (&source_list, hook, TRUE);
g_hook_unref (&source_list, hook);
hook = tmp;
@@ -534,7 +534,7 @@ g_main_iterate (gboolean block,
break;
if (G_HOOK_IN_CALL (hook) && !(hook->flags & G_SOURCE_CAN_RECURSE))
{
- hook = g_hook_next_valid (hook, TRUE);
+ hook = g_hook_next_valid (&source_list, hook, TRUE);
continue;
}
@@ -561,7 +561,7 @@ g_main_iterate (gboolean block,
}
}
- tmp = g_hook_next_valid (hook, TRUE);
+ tmp = g_hook_next_valid (&source_list, hook, TRUE);
g_hook_unref (&source_list, hook);
hook = tmp;