summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author3 <alexl@redhat.com>2001-01-23 07:35:52 +0000
committerAlexander Larsson <alexl@src.gnome.org>2001-01-23 07:35:52 +0000
commit6d145180181075ac9aae1b46af3cddc6e90d4ed2 (patch)
treea176f3b2afb735e4a8fca56fdfaedb3f0f5dfc77
parent3bab7875f1adf8ff5e3b00ccc8ed8aee462cfc8e (diff)
Free the callback (g_source_set_callback): Initialize the callback
2001-01-23 <alexl@redhat.com> * gmain.c (g_source_callback_unref): Free the callback (g_source_set_callback): Initialize the callback refcount
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-2-05
-rw-r--r--ChangeLog.pre-2-105
-rw-r--r--ChangeLog.pre-2-125
-rw-r--r--ChangeLog.pre-2-25
-rw-r--r--ChangeLog.pre-2-45
-rw-r--r--ChangeLog.pre-2-65
-rw-r--r--ChangeLog.pre-2-85
-rw-r--r--glib/gmain.c4
-rw-r--r--gmain.c4
10 files changed, 46 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index aa0d3eb6b..eaffff357 100644
--- 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
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index aa0d3eb6b..eaffff357 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -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
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index aa0d3eb6b..eaffff357 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -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
diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12
index aa0d3eb6b..eaffff357 100644
--- a/ChangeLog.pre-2-12
+++ b/ChangeLog.pre-2-12
@@ -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
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index aa0d3eb6b..eaffff357 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -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
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index aa0d3eb6b..eaffff357 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -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
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index aa0d3eb6b..eaffff357 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -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
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index aa0d3eb6b..eaffff357 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -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
diff --git a/glib/gmain.c b/glib/gmain.c
index 29af3b0e7..c9e3577e8 100644
--- a/glib/gmain.c
+++ b/glib/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;
diff --git a/gmain.c b/gmain.c
index 29af3b0e7..c9e3577e8 100644
--- 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;