aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-05-23 03:12:49 +0800
committerDan Winship <danw@src.gnome.org>2001-05-23 03:12:49 +0800
commite16ec956d76ab269e645e4c6d2f3eb5fbc01c027 (patch)
treedde10301cbc675d7f47eb39cce3598cc81a5dbf3 /addressbook/backend
parent806c15f6ff9325617091318670b9e0e41fb467ec (diff)
downloadgsoc2013-evolution-e16ec956d76ab269e645e4c6d2f3eb5fbc01c027.tar
gsoc2013-evolution-e16ec956d76ab269e645e4c6d2f3eb5fbc01c027.tar.gz
gsoc2013-evolution-e16ec956d76ab269e645e4c6d2f3eb5fbc01c027.tar.bz2
gsoc2013-evolution-e16ec956d76ab269e645e4c6d2f3eb5fbc01c027.tar.lz
gsoc2013-evolution-e16ec956d76ab269e645e4c6d2f3eb5fbc01c027.tar.xz
gsoc2013-evolution-e16ec956d76ab269e645e4c6d2f3eb5fbc01c027.tar.zst
gsoc2013-evolution-e16ec956d76ab269e645e4c6d2f3eb5fbc01c027.zip
ref the listener for the duration of this function, since emitting
* backend/ebook/e-book-listener.c (e_book_listener_check_queue): ref the listener for the duration of this function, since emitting "responses_queued" may cause it to be unreffed by its EBook in some cases, which could cause the second response_queue check to look at garbage data if it got destroyed. (e_book_listener_destroy): Call g_source_remove if idle_id is set. svn path=/trunk/; revision=9935
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/e-book-listener.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/addressbook/backend/ebook/e-book-listener.c b/addressbook/backend/ebook/e-book-listener.c
index ee4107190b..f9d4f67f97 100644
--- a/addressbook/backend/ebook/e-book-listener.c
+++ b/addressbook/backend/ebook/e-book-listener.c
@@ -33,6 +33,7 @@ struct _EBookListenerPrivate {
static gboolean
e_book_listener_check_queue (EBookListener *listener)
{
+ gtk_object_ref (GTK_OBJECT (listener));
if (listener->priv->response_queue != NULL) {
gtk_signal_emit (GTK_OBJECT (listener),
e_book_listener_signals [RESPONSES_QUEUED]);
@@ -40,9 +41,11 @@ e_book_listener_check_queue (EBookListener *listener)
if (listener->priv->response_queue == NULL) {
listener->priv->idle_id = 0;
+ gtk_object_unref (GTK_OBJECT (listener));
return FALSE;
}
+ gtk_object_unref (GTK_OBJECT (listener));
return TRUE;
}
@@ -624,6 +627,9 @@ e_book_listener_destroy (GtkObject *object)
}
g_list_free (listener->priv->response_queue);
+ if (listener->priv->idle_id)
+ g_source_remove (listener->priv->idle_id);
+
g_free (listener->priv);
GTK_OBJECT_CLASS (e_book_listener_parent_class)->destroy (object);