aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog9
-rw-r--r--addressbook/backend/ebook/e-book-listener.c6
2 files changed, 15 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index d256afe915..44c07add82 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,12 @@
+2001-05-22 Dan Winship <danw@ximian.com>
+
+ * 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.
+
2001-05-22 Chris Toshok <toshok@ximian.com>
* gui/component/addressbook.c: track the change in
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);