Fix handling of user data when locating sources. (#60414, Katsuhiro Okuno)
authorOwen Taylor <otaylor@redhat.com>
Wed, 19 Sep 2001 20:39:21 +0000 (20:39 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 19 Sep 2001 20:39:21 +0000 (20:39 +0000)
Wed Sep 19 16:35:22 2001  Owen Taylor  <otaylor@redhat.com>

* glib/gmain.c (g_main_context_find_source_by[_funcs]_user_data):
Fix handling of user data when locating sources.
(#60414, Katsuhiro Okuno)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gmain.c

index afe33f1..2bda7ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Sep 19 16:35:22 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * 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  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#59806)
@@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001  Owen Taylor  <otaylor@redhat.com>
        * glib/gmessages.c (printf_string_upper_bound): Don't
        segfault when warning about positional parameters.
 
-Wed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
+Wzed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}:
        Patch from Darin Adler to remove GReal* structures in
index afe33f1..2bda7ba 100644 (file)
@@ -1,3 +1,9 @@
+Wed Sep 19 16:35:22 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * 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  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#59806)
@@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001  Owen Taylor  <otaylor@redhat.com>
        * glib/gmessages.c (printf_string_upper_bound): Don't
        segfault when warning about positional parameters.
 
-Wed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
+Wzed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}:
        Patch from Darin Adler to remove GReal* structures in
index afe33f1..2bda7ba 100644 (file)
@@ -1,3 +1,9 @@
+Wed Sep 19 16:35:22 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * 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  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#59806)
@@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001  Owen Taylor  <otaylor@redhat.com>
        * glib/gmessages.c (printf_string_upper_bound): Don't
        segfault when warning about positional parameters.
 
-Wed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
+Wzed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}:
        Patch from Darin Adler to remove GReal* structures in
index afe33f1..2bda7ba 100644 (file)
@@ -1,3 +1,9 @@
+Wed Sep 19 16:35:22 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * 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  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#59806)
@@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001  Owen Taylor  <otaylor@redhat.com>
        * glib/gmessages.c (printf_string_upper_bound): Don't
        segfault when warning about positional parameters.
 
-Wed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
+Wzed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}:
        Patch from Darin Adler to remove GReal* structures in
index afe33f1..2bda7ba 100644 (file)
@@ -1,3 +1,9 @@
+Wed Sep 19 16:35:22 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * 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  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#59806)
@@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001  Owen Taylor  <otaylor@redhat.com>
        * glib/gmessages.c (printf_string_upper_bound): Don't
        segfault when warning about positional parameters.
 
-Wed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
+Wzed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}:
        Patch from Darin Adler to remove GReal* structures in
index afe33f1..2bda7ba 100644 (file)
@@ -1,3 +1,9 @@
+Wed Sep 19 16:35:22 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * 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  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#59806)
@@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001  Owen Taylor  <otaylor@redhat.com>
        * glib/gmessages.c (printf_string_upper_bound): Don't
        segfault when warning about positional parameters.
 
-Wed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
+Wzed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}:
        Patch from Darin Adler to remove GReal* structures in
index afe33f1..2bda7ba 100644 (file)
@@ -1,3 +1,9 @@
+Wed Sep 19 16:35:22 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * 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  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#59806)
@@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001  Owen Taylor  <otaylor@redhat.com>
        * glib/gmessages.c (printf_string_upper_bound): Don't
        segfault when warning about positional parameters.
 
-Wed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
+Wzed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}:
        Patch from Darin Adler to remove GReal* structures in
index afe33f1..2bda7ba 100644 (file)
@@ -1,3 +1,9 @@
+Wed Sep 19 16:35:22 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * 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  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#59806)
@@ -17,7 +23,7 @@ Wed Sep 19 14:17:31 2001  Owen Taylor  <otaylor@redhat.com>
        * glib/gmessages.c (printf_string_upper_bound): Don't
        segfault when warning about positional parameters.
 
-Wed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
+Wzed Sep 19 14:05:27 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/{gcache.c,gmem.c,grel.c,gstring.c,gtimer.c,gtree}:
        Patch from Darin Adler to remove GReal* structures in
index cebf552..fe152f3 100644 (file)
@@ -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);