From: Owen Taylor Date: Wed, 19 Sep 2001 20:39:21 +0000 (+0000) Subject: Fix handling of user data when locating sources. (#60414, Katsuhiro Okuno) X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=ffe592544fbc7527f489bc13e91bebccf6ceb4f7;p=dana%2Fcg-glib.git Fix handling of user data when locating sources. (#60414, Katsuhiro Okuno) Wed Sep 19 16:35:22 2001 Owen Taylor * glib/gmain.c (g_main_context_find_source_by[_funcs]_user_data): Fix handling of user data when locating sources. (#60414, Katsuhiro Okuno) --- diff --git a/ChangeLog b/ChangeLog index afe33f1d..2bda7ba1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Sep 19 16:35:22 2001 Owen Taylor + + * glib/gmain.c (g_main_context_find_source_by[_funcs]_user_data): + Fix handling of user data when locating sources. + (#60414, Katsuhiro Okuno) + Wed Sep 19 14:17:31 2001 Owen Taylor Patch from Matthias Clasen (#59806) @@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001 Owen Taylor * glib/gmessages.c (printf_string_upper_bound): Don't segfault when warning about positional parameters. -Wed Sep 19 14:05:27 2001 Owen Taylor +Wzed Sep 19 14:05:27 2001 Owen Taylor * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}: Patch from Darin Adler to remove GReal* structures in diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index afe33f1d..2bda7ba1 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Wed Sep 19 16:35:22 2001 Owen Taylor + + * glib/gmain.c (g_main_context_find_source_by[_funcs]_user_data): + Fix handling of user data when locating sources. + (#60414, Katsuhiro Okuno) + Wed Sep 19 14:17:31 2001 Owen Taylor Patch from Matthias Clasen (#59806) @@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001 Owen Taylor * glib/gmessages.c (printf_string_upper_bound): Don't segfault when warning about positional parameters. -Wed Sep 19 14:05:27 2001 Owen Taylor +Wzed Sep 19 14:05:27 2001 Owen Taylor * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}: Patch from Darin Adler to remove GReal* structures in diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index afe33f1d..2bda7ba1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Wed Sep 19 16:35:22 2001 Owen Taylor + + * glib/gmain.c (g_main_context_find_source_by[_funcs]_user_data): + Fix handling of user data when locating sources. + (#60414, Katsuhiro Okuno) + Wed Sep 19 14:17:31 2001 Owen Taylor Patch from Matthias Clasen (#59806) @@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001 Owen Taylor * glib/gmessages.c (printf_string_upper_bound): Don't segfault when warning about positional parameters. -Wed Sep 19 14:05:27 2001 Owen Taylor +Wzed Sep 19 14:05:27 2001 Owen Taylor * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}: Patch from Darin Adler to remove GReal* structures in diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index afe33f1d..2bda7ba1 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +Wed Sep 19 16:35:22 2001 Owen Taylor + + * glib/gmain.c (g_main_context_find_source_by[_funcs]_user_data): + Fix handling of user data when locating sources. + (#60414, Katsuhiro Okuno) + Wed Sep 19 14:17:31 2001 Owen Taylor Patch from Matthias Clasen (#59806) @@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001 Owen Taylor * glib/gmessages.c (printf_string_upper_bound): Don't segfault when warning about positional parameters. -Wed Sep 19 14:05:27 2001 Owen Taylor +Wzed Sep 19 14:05:27 2001 Owen Taylor * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}: Patch from Darin Adler to remove GReal* structures in diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index afe33f1d..2bda7ba1 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Wed Sep 19 16:35:22 2001 Owen Taylor + + * glib/gmain.c (g_main_context_find_source_by[_funcs]_user_data): + Fix handling of user data when locating sources. + (#60414, Katsuhiro Okuno) + Wed Sep 19 14:17:31 2001 Owen Taylor Patch from Matthias Clasen (#59806) @@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001 Owen Taylor * glib/gmessages.c (printf_string_upper_bound): Don't segfault when warning about positional parameters. -Wed Sep 19 14:05:27 2001 Owen Taylor +Wzed Sep 19 14:05:27 2001 Owen Taylor * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}: Patch from Darin Adler to remove GReal* structures in diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index afe33f1d..2bda7ba1 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Wed Sep 19 16:35:22 2001 Owen Taylor + + * glib/gmain.c (g_main_context_find_source_by[_funcs]_user_data): + Fix handling of user data when locating sources. + (#60414, Katsuhiro Okuno) + Wed Sep 19 14:17:31 2001 Owen Taylor Patch from Matthias Clasen (#59806) @@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001 Owen Taylor * glib/gmessages.c (printf_string_upper_bound): Don't segfault when warning about positional parameters. -Wed Sep 19 14:05:27 2001 Owen Taylor +Wzed Sep 19 14:05:27 2001 Owen Taylor * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}: Patch from Darin Adler to remove GReal* structures in diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index afe33f1d..2bda7ba1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Wed Sep 19 16:35:22 2001 Owen Taylor + + * glib/gmain.c (g_main_context_find_source_by[_funcs]_user_data): + Fix handling of user data when locating sources. + (#60414, Katsuhiro Okuno) + Wed Sep 19 14:17:31 2001 Owen Taylor Patch from Matthias Clasen (#59806) @@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001 Owen Taylor * glib/gmessages.c (printf_string_upper_bound): Don't segfault when warning about positional parameters. -Wed Sep 19 14:05:27 2001 Owen Taylor +Wzed Sep 19 14:05:27 2001 Owen Taylor * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}: Patch from Darin Adler to remove GReal* structures in diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index afe33f1d..2bda7ba1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Wed Sep 19 16:35:22 2001 Owen Taylor + + * glib/gmain.c (g_main_context_find_source_by[_funcs]_user_data): + Fix handling of user data when locating sources. + (#60414, Katsuhiro Okuno) + Wed Sep 19 14:17:31 2001 Owen Taylor Patch from Matthias Clasen (#59806) @@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001 Owen Taylor * glib/gmessages.c (printf_string_upper_bound): Don't segfault when warning about positional parameters. -Wed Sep 19 14:05:27 2001 Owen Taylor +Wzed Sep 19 14:05:27 2001 Owen Taylor * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}: Patch from Darin Adler to remove GReal* structures in diff --git a/glib/gmain.c b/glib/gmain.c index cebf5529..fe152f3a 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -1381,8 +1381,16 @@ g_main_context_find_source_by_funcs_user_data (GMainContext *context, { if (!SOURCE_DESTROYED (source) && source->source_funcs == funcs && - source->callback_data == user_data) - break; + source->callback_funcs) + { + GSourceFunc callback; + gpointer callback_data; + + source->callback_funcs->get (source->callback_data, source, &callback, &callback_data); + + if (callback_data == user_data) + break; + } source = source->next; } @@ -1417,8 +1425,16 @@ g_main_context_find_source_by_user_data (GMainContext *context, while (source) { if (!SOURCE_DESTROYED (source) && - source->callback_data == user_data) - break; + source->callback_funcs) + { + GSourceFunc callback; + gpointer callback_data = NULL; + + source->callback_funcs->get (source->callback_data, source, &callback, &callback_data); + + if (callback_data == user_data) + break; + } source = source->next; } @@ -1592,11 +1608,11 @@ g_main_dispatch (GMainContext *context) was_in_call = source->flags & G_HOOK_FLAG_IN_CALL; source->flags |= G_HOOK_FLAG_IN_CALL; - UNLOCK_CONTEXT (context); - if (cb_funcs) cb_funcs->get (cb_data, source, &callback, &user_data); + UNLOCK_CONTEXT (context); + need_destroy = ! dispatch (source, callback, user_data);