aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-07-18 03:38:18 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-07-18 03:38:18 +0800
commit2890d2c2a1ffdd60f0540b04d7e569c0d8b84127 (patch)
treefdaa85b6d48fa5277798d7786b526e8fc63b552b /addressbook/backend/ebook
parent217e75d071c4de2305d44af930e7a6ebd7b453f0 (diff)
downloadgsoc2013-evolution-2890d2c2a1ffdd60f0540b04d7e569c0d8b84127.tar
gsoc2013-evolution-2890d2c2a1ffdd60f0540b04d7e569c0d8b84127.tar.gz
gsoc2013-evolution-2890d2c2a1ffdd60f0540b04d7e569c0d8b84127.tar.bz2
gsoc2013-evolution-2890d2c2a1ffdd60f0540b04d7e569c0d8b84127.tar.lz
gsoc2013-evolution-2890d2c2a1ffdd60f0540b04d7e569c0d8b84127.tar.xz
gsoc2013-evolution-2890d2c2a1ffdd60f0540b04d7e569c0d8b84127.tar.zst
gsoc2013-evolution-2890d2c2a1ffdd60f0540b04d7e569c0d8b84127.zip
Hold a reference to our listener while the idle function is active.
2001-07-17 Jon Trowbridge <trow@ximian.com> * backend/ebook/e-book-view-listener.c (e_book_view_listener_queue_response): Hold a reference to our listener while the idle function is active. (e_book_view_listener_check_queue): Only unref the listener when the idle function is finished. * gui/component/select-names/e-select-names-manager.c (e_select_names_clicked): Instead of replacing section->model with source, copy source onto section->model with e_select_names_model_overwrite_copy. #if 0/#endif out all of the stuff related to ETextModels, because it doesn't make any sense to me, and everything appears to work without it. (Die bug #2059. Die! Die! Die!) * gui/component/select-names/e-select-names-model.c (e_select_names_model_overwrite_copy): Added. Copies the contents of one ESelectNamesModel onto another. * backend/ebook/e-destination.c (e_destination_copy): Made the argument const. svn path=/trunk/; revision=11165
Diffstat (limited to 'addressbook/backend/ebook')
-rw-r--r--addressbook/backend/ebook/e-book-view-listener.c22
-rw-r--r--addressbook/backend/ebook/e-destination.c2
-rw-r--r--addressbook/backend/ebook/e-destination.h2
3 files changed, 16 insertions, 10 deletions
diff --git a/addressbook/backend/ebook/e-book-view-listener.c b/addressbook/backend/ebook/e-book-view-listener.c
index f1fd4d4519..d0323a9874 100644
--- a/addressbook/backend/ebook/e-book-view-listener.c
+++ b/addressbook/backend/ebook/e-book-view-listener.c
@@ -58,19 +58,21 @@ e_book_view_listener_check_queue (EBookViewListener *listener)
else
thrash = 0;
- if (thrash > 20) {
- g_error ("e_book_view_listener_check_queue thrashing!");
- thrash = 0;
- listener->priv->idle_id = 0;
- return FALSE;
- }
+ if (thrash > 20 || listener->priv->response_queue == NULL) {
- if (listener->priv->response_queue == NULL) {
+ if (thrash > 20) {
+ g_error ("e_book_view_listener_check_queue thrashing!");
+ thrash = 0;
+ }
+
listener->priv->idle_id = 0;
+
+ /* Only release our listener reference when the idle is finished. */
bonobo_object_unref (BONOBO_OBJECT (listener));
+
return FALSE;
}
- bonobo_object_unref (BONOBO_OBJECT (listener));
+
return TRUE;
}
@@ -84,6 +86,10 @@ e_book_view_listener_queue_response (EBookViewListener *listener,
response);
if (listener->priv->idle_id == 0) {
+
+ /* Hold a reference to the listener while the idle is active. */
+ gtk_object_ref (GTK_OBJECT (listener));
+
listener->priv->idle_id = g_idle_add (
(GSourceFunc) e_book_view_listener_check_queue, listener);
}
diff --git a/addressbook/backend/ebook/e-destination.c b/addressbook/backend/ebook/e-destination.c
index 42377aaa33..f470769a2e 100644
--- a/addressbook/backend/ebook/e-destination.c
+++ b/addressbook/backend/ebook/e-destination.c
@@ -119,7 +119,7 @@ e_destination_new (void)
}
EDestination *
-e_destination_copy (EDestination *dest)
+e_destination_copy (const EDestination *dest)
{
EDestination *new_dest;
GList *iter;
diff --git a/addressbook/backend/ebook/e-destination.h b/addressbook/backend/ebook/e-destination.h
index c4d742afbe..c53f255436 100644
--- a/addressbook/backend/ebook/e-destination.h
+++ b/addressbook/backend/ebook/e-destination.h
@@ -60,7 +60,7 @@ GtkType e_destination_get_type (void);
EDestination *e_destination_new (void);
-EDestination *e_destination_copy (EDestination *);
+EDestination *e_destination_copy (const EDestination *);
void e_destination_clear (EDestination *);
gboolean e_destination_is_empty (EDestination *);