diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-07-18 02:47:44 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-07-18 02:47:44 +0800 |
commit | 217e75d071c4de2305d44af930e7a6ebd7b453f0 (patch) | |
tree | d9fe5954c026019c9ad5037e801eb7a279b5837c /addressbook/backend/ebook/e-book-listener.c | |
parent | d54c49a59b9f56f48ab8e04856fe7134c6b1787a (diff) | |
download | gsoc2013-evolution-217e75d071c4de2305d44af930e7a6ebd7b453f0.tar gsoc2013-evolution-217e75d071c4de2305d44af930e7a6ebd7b453f0.tar.gz gsoc2013-evolution-217e75d071c4de2305d44af930e7a6ebd7b453f0.tar.bz2 gsoc2013-evolution-217e75d071c4de2305d44af930e7a6ebd7b453f0.tar.lz gsoc2013-evolution-217e75d071c4de2305d44af930e7a6ebd7b453f0.tar.xz gsoc2013-evolution-217e75d071c4de2305d44af930e7a6ebd7b453f0.tar.zst gsoc2013-evolution-217e75d071c4de2305d44af930e7a6ebd7b453f0.zip |
Removed old, broken code and annoying g_messages.
2001-07-17 Jon Trowbridge <trow@ximian.com>
* backend/ebook/e-destination.c (e_destination_set_string): Removed
old, broken code and annoying g_messages.
* backend/ebook/e-book-listener.c
(e_book_listener_queue_response): Hold a reference to the listener
while the idle function is active.
(e_book_listener_check_queue): Only release our reference to the
listener when the queue is empty. These two changes fix a race
condition, since the listener could be unrefed while the listener
was still active. (Seems to fix bug #4485)
svn path=/trunk/; revision=11164
Diffstat (limited to 'addressbook/backend/ebook/e-book-listener.c')
-rw-r--r-- | addressbook/backend/ebook/e-book-listener.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/addressbook/backend/ebook/e-book-listener.c b/addressbook/backend/ebook/e-book-listener.c index 7670a8b35d..dd682cbce4 100644 --- a/addressbook/backend/ebook/e-book-listener.c +++ b/addressbook/backend/ebook/e-book-listener.c @@ -33,7 +33,6 @@ 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]); @@ -41,11 +40,14 @@ e_book_listener_check_queue (EBookListener *listener) if (listener->priv->response_queue == NULL) { listener->priv->idle_id = 0; + + /* We only release our reference to the listener when the idle + function is totally finished. */ gtk_object_unref (GTK_OBJECT (listener)); + return FALSE; } - gtk_object_unref (GTK_OBJECT (listener)); return TRUE; } @@ -58,6 +60,10 @@ e_book_listener_queue_response (EBookListener *listener, response); if (listener->priv->idle_id == 0) { + + /* Hold a reference to the listener until the idle function is finished. */ + gtk_object_ref (GTK_OBJECT (listener)); + listener->priv->idle_id = g_idle_add ( (GSourceFunc) e_book_listener_check_queue, listener); } |