+Wed Dec 13 20:41:49 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gmain.c (g_source_unref_internal): Unref callback->cb_data
+ if it was still set when the source is freed. (Usually, this
+ will be done by g_source_destroy.)
+
2001-01-02 Dan Winship <danw@helixcode.com>
* garray.h (g_array_append_val, g_array_prepend_val,
+Wed Dec 13 20:41:49 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gmain.c (g_source_unref_internal): Unref callback->cb_data
+ if it was still set when the source is freed. (Usually, this
+ will be done by g_source_destroy.)
+
2001-01-02 Dan Winship <danw@helixcode.com>
* garray.h (g_array_append_val, g_array_prepend_val,
+Wed Dec 13 20:41:49 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gmain.c (g_source_unref_internal): Unref callback->cb_data
+ if it was still set when the source is freed. (Usually, this
+ will be done by g_source_destroy.)
+
2001-01-02 Dan Winship <danw@helixcode.com>
* garray.h (g_array_append_val, g_array_prepend_val,
+Wed Dec 13 20:41:49 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gmain.c (g_source_unref_internal): Unref callback->cb_data
+ if it was still set when the source is freed. (Usually, this
+ will be done by g_source_destroy.)
+
2001-01-02 Dan Winship <danw@helixcode.com>
* garray.h (g_array_append_val, g_array_prepend_val,
+Wed Dec 13 20:41:49 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gmain.c (g_source_unref_internal): Unref callback->cb_data
+ if it was still set when the source is freed. (Usually, this
+ will be done by g_source_destroy.)
+
2001-01-02 Dan Winship <danw@helixcode.com>
* garray.h (g_array_append_val, g_array_prepend_val,
+Wed Dec 13 20:41:49 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gmain.c (g_source_unref_internal): Unref callback->cb_data
+ if it was still set when the source is freed. (Usually, this
+ will be done by g_source_destroy.)
+
2001-01-02 Dan Winship <danw@helixcode.com>
* garray.h (g_array_append_val, g_array_prepend_val,
+Wed Dec 13 20:41:49 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gmain.c (g_source_unref_internal): Unref callback->cb_data
+ if it was still set when the source is freed. (Usually, this
+ will be done by g_source_destroy.)
+
2001-01-02 Dan Winship <danw@helixcode.com>
* garray.h (g_array_append_val, g_array_prepend_val,
+Wed Dec 13 20:41:49 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gmain.c (g_source_unref_internal): Unref callback->cb_data
+ if it was still set when the source is freed. (Usually, this
+ will be done by g_source_destroy.)
+
2001-01-02 Dan Winship <danw@helixcode.com>
* garray.h (g_array_append_val, g_array_prepend_val,
GMainContext *context,
gboolean have_lock)
{
- gpointer cb_data = NULL;
- GSourceCallbackFuncs *cb_funcs = NULL;
- GSList *tmp_list;
+ gpointer old_cb_data = NULL;
+ GSourceCallbackFuncs *old_cb_funcs = NULL;
g_return_if_fail (source != NULL);
source->ref_count--;
if (source->ref_count == 0)
{
+ old_cb_data = source->callback_data;
+ old_cb_funcs = source->callback_funcs;
+
+ source->callback_data = NULL;
+ source->callback_funcs = NULL;
+
if (context && !SOURCE_DESTROYED (source))
{
g_warning (G_STRLOC ": ref_count == 0, but source is still attached to a context!");
if (!have_lock && context)
UNLOCK_CONTEXT (context);
- if (cb_data)
+ if (old_cb_funcs)
{
if (have_lock)
UNLOCK_CONTEXT (context);
- cb_funcs->unref (cb_data);
+ old_cb_funcs->unref (old_cb_data);
if (have_lock)
LOCK_CONTEXT (context);
GMainContext *context,
gboolean have_lock)
{
- gpointer cb_data = NULL;
- GSourceCallbackFuncs *cb_funcs = NULL;
- GSList *tmp_list;
+ gpointer old_cb_data = NULL;
+ GSourceCallbackFuncs *old_cb_funcs = NULL;
g_return_if_fail (source != NULL);
source->ref_count--;
if (source->ref_count == 0)
{
+ old_cb_data = source->callback_data;
+ old_cb_funcs = source->callback_funcs;
+
+ source->callback_data = NULL;
+ source->callback_funcs = NULL;
+
if (context && !SOURCE_DESTROYED (source))
{
g_warning (G_STRLOC ": ref_count == 0, but source is still attached to a context!");
if (!have_lock && context)
UNLOCK_CONTEXT (context);
- if (cb_data)
+ if (old_cb_funcs)
{
if (have_lock)
UNLOCK_CONTEXT (context);
- cb_funcs->unref (cb_data);
+ old_cb_funcs->unref (old_cb_data);
if (have_lock)
LOCK_CONTEXT (context);