Unref pending dispatches when discarding them.
authorOwen Taylor <otaylor@redhat.com>
Wed, 6 Feb 2002 00:37:38 +0000 (00:37 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 6 Feb 2002 00:37:38 +0000 (00:37 +0000)
Tue Feb  5 17:13:02 2002  Owen Taylor  <otaylor@redhat.com>

        * glib/gmain.c (g_main_context_prepare): Unref pending
        dispatches when discarding them.

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 2a5212a..880dc31 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Feb  5 17:13:02 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gmain.c (g_main_context_prepare): Unref pending
+       dispatches when discarding them.
+
 2002-02-04  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gthread.c (g_thread_create_full): Delay allocation until
index 2a5212a..880dc31 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb  5 17:13:02 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gmain.c (g_main_context_prepare): Unref pending
+       dispatches when discarding them.
+
 2002-02-04  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gthread.c (g_thread_create_full): Delay allocation until
index 2a5212a..880dc31 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb  5 17:13:02 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gmain.c (g_main_context_prepare): Unref pending
+       dispatches when discarding them.
+
 2002-02-04  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gthread.c (g_thread_create_full): Delay allocation until
index 2a5212a..880dc31 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb  5 17:13:02 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gmain.c (g_main_context_prepare): Unref pending
+       dispatches when discarding them.
+
 2002-02-04  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gthread.c (g_thread_create_full): Delay allocation until
index 2a5212a..880dc31 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb  5 17:13:02 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gmain.c (g_main_context_prepare): Unref pending
+       dispatches when discarding them.
+
 2002-02-04  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gthread.c (g_thread_create_full): Delay allocation until
index 2a5212a..880dc31 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb  5 17:13:02 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gmain.c (g_main_context_prepare): Unref pending
+       dispatches when discarding them.
+
 2002-02-04  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gthread.c (g_thread_create_full): Delay allocation until
index 2a5212a..880dc31 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb  5 17:13:02 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gmain.c (g_main_context_prepare): Unref pending
+       dispatches when discarding them.
+
 2002-02-04  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gthread.c (g_thread_create_full): Delay allocation until
index 2a5212a..880dc31 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb  5 17:13:02 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gmain.c (g_main_context_prepare): Unref pending
+       dispatches when discarding them.
+
 2002-02-04  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gthread.c (g_thread_create_full): Delay allocation until
index f359596..6f0c2bf 100644 (file)
@@ -1846,6 +1846,7 @@ gboolean
 g_main_context_prepare (GMainContext *context,
                        gint         *priority)
 {
+  gint i;
   gint n_ready = 0;
   gint current_priority = G_MAXINT;
   GSource *source;
@@ -1889,6 +1890,9 @@ g_main_context_prepare (GMainContext *context,
 #endif
 
   /* If recursing, clear list of pending dispatches */
+
+  for (i = 0; i < context->pending_dispatches->len; i++)
+    SOURCE_UNREF ((GSource *)context->pending_dispatches->pdata[i], context);
   g_ptr_array_set_size (context->pending_dispatches, 0);
   
   /* Prepare all sources */