Free the callback (g_source_set_callback): Initialize the callback
author3 <alexl@redhat.com>
Tue, 23 Jan 2001 07:35:52 +0000 (07:35 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Tue, 23 Jan 2001 07:35:52 +0000 (07:35 +0000)
2001-01-23    <alexl@redhat.com>

* gmain.c (g_source_callback_unref): Free the callback
(g_source_set_callback): Initialize the callback refcount

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
gmain.c

index aa0d3eb..eaffff3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-23    <alexl@redhat.com>
+
+       * gmain.c (g_source_callback_unref): Free the callback
+       (g_source_set_callback): Initialize the callback refcount
+
 2001-01-20  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_get_codeset): (Win32) Even if g_get_codeset() is
index aa0d3eb..eaffff3 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-23    <alexl@redhat.com>
+
+       * gmain.c (g_source_callback_unref): Free the callback
+       (g_source_set_callback): Initialize the callback refcount
+
 2001-01-20  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_get_codeset): (Win32) Even if g_get_codeset() is
index aa0d3eb..eaffff3 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-23    <alexl@redhat.com>
+
+       * gmain.c (g_source_callback_unref): Free the callback
+       (g_source_set_callback): Initialize the callback refcount
+
 2001-01-20  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_get_codeset): (Win32) Even if g_get_codeset() is
index aa0d3eb..eaffff3 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-23    <alexl@redhat.com>
+
+       * gmain.c (g_source_callback_unref): Free the callback
+       (g_source_set_callback): Initialize the callback refcount
+
 2001-01-20  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_get_codeset): (Win32) Even if g_get_codeset() is
index aa0d3eb..eaffff3 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-23    <alexl@redhat.com>
+
+       * gmain.c (g_source_callback_unref): Free the callback
+       (g_source_set_callback): Initialize the callback refcount
+
 2001-01-20  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_get_codeset): (Win32) Even if g_get_codeset() is
index aa0d3eb..eaffff3 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-23    <alexl@redhat.com>
+
+       * gmain.c (g_source_callback_unref): Free the callback
+       (g_source_set_callback): Initialize the callback refcount
+
 2001-01-20  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_get_codeset): (Win32) Even if g_get_codeset() is
index aa0d3eb..eaffff3 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-23    <alexl@redhat.com>
+
+       * gmain.c (g_source_callback_unref): Free the callback
+       (g_source_set_callback): Initialize the callback refcount
+
 2001-01-20  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_get_codeset): (Win32) Even if g_get_codeset() is
index aa0d3eb..eaffff3 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-23    <alexl@redhat.com>
+
+       * gmain.c (g_source_callback_unref): Free the callback
+       (g_source_set_callback): Initialize the callback refcount
+
 2001-01-20  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c (g_get_codeset): (Win32) Even if g_get_codeset() is
index 29af3b0..c9e3577 100644 (file)
@@ -984,6 +984,7 @@ g_source_callback_unref (gpointer cb_data)
     {
       if (callback->notify)
        callback->notify (callback->data);
+      g_free (callback);
     }
 }
 
@@ -1024,7 +1025,8 @@ g_source_set_callback (GSource        *source,
   g_return_if_fail (source != NULL);
 
   new_callback = g_new (GSourceCallback, 1);
-  
+
+  new_callback->ref_count = 1;
   new_callback->func = func;
   new_callback->data = data;
   new_callback->notify = notify;
diff --git a/gmain.c b/gmain.c
index 29af3b0..c9e3577 100644 (file)
--- a/gmain.c
+++ b/gmain.c
@@ -984,6 +984,7 @@ g_source_callback_unref (gpointer cb_data)
     {
       if (callback->notify)
        callback->notify (callback->data);
+      g_free (callback);
     }
 }
 
@@ -1024,7 +1025,8 @@ g_source_set_callback (GSource        *source,
   g_return_if_fail (source != NULL);
 
   new_callback = g_new (GSourceCallback, 1);
-  
+
+  new_callback->ref_count = 1;
   new_callback->func = func;
   new_callback->data = data;
   new_callback->notify = notify;