add ref/unref around this function body so that we don't get unreffed by
authorChris Toshok <toshok@ximian.com>
Fri, 30 Jan 2004 23:14:19 +0000 (23:14 +0000)
committerChris Toshok <toshok@src.gnome.org>
Fri, 30 Jan 2004 23:14:19 +0000 (23:14 +0000)
2004-01-30  Chris Toshok  <toshok@ximian.com>

* libedata-book/e-book-backend.c (e_book_backend_remove_client):
add ref/unref around this function body so that we don't get
unreffed by something below last_client_gone.

addressbook/ChangeLog
addressbook/libedata-book/e-book-backend.c

index cc97f33..0f6aa15 100644 (file)
@@ -1,3 +1,9 @@
+2004-01-30  Chris Toshok  <toshok@ximian.com>
+
+       * libedata-book/e-book-backend.c (e_book_backend_remove_client):
+       add ref/unref around this function body so that we don't get
+       unreffed by something below last_client_gone.
+
 2004-01-29  Chris Toshok  <toshok@ximian.com>
 
        * libedata-book/ximian-vcard.h (XIMIAN_VCARD): update for new
index a86eb27..306fa82 100644 (file)
@@ -369,6 +369,11 @@ e_book_backend_remove_client (EBookBackend *backend,
        g_return_if_fail (E_IS_BOOK_BACKEND (backend));
        g_return_if_fail (E_IS_DATA_BOOK (book));
 
+       /* up our backend's refcount here so that last_client_gone
+          doesn't end up unreffing us (while we're holding the
+          lock) */
+       g_object_ref (backend);
+
        /* Disconnect */
        g_mutex_lock (backend->priv->clients_mutex);
        backend->priv->clients = g_list_remove (backend->priv->clients, book);
@@ -380,6 +385,8 @@ e_book_backend_remove_client (EBookBackend *backend,
                last_client_gone (backend);
 
        g_mutex_unlock (backend->priv->clients_mutex);
+
+       g_object_unref (backend);
 }
 
 char *