[evolution-data-server] e_book_backend_remove_view(): Check for match before unreffing view.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] e_book_backend_remove_view(): Check for match before unreffing view.
- Date: Mon, 25 Mar 2013 15:28:28 +0000 (UTC)
commit 2ef33a6754ff65ad750ab098d99612f6f5656a2c
Author: Matthew Barnes <mbarnes redhat com>
Date: Mon Mar 25 11:23:52 2013 -0400
e_book_backend_remove_view(): Check for match before unreffing view.
addressbook/libedata-book/e-book-backend.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index 1a192f1..4f17bcb 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -902,12 +902,21 @@ void
e_book_backend_remove_view (EBookBackend *backend,
EDataBookView *view)
{
+ GList *list, *link;
+
g_return_if_fail (E_IS_BOOK_BACKEND (backend));
g_mutex_lock (&backend->priv->views_mutex);
- backend->priv->views = g_list_remove (backend->priv->views, view);
- g_object_unref (view);
+ list = backend->priv->views;
+
+ link = g_list_find (list, view);
+ if (link != NULL) {
+ g_object_unref (view);
+ list = g_list_delete_link (list, link);
+ }
+
+ backend->priv->views = list;
g_mutex_unlock (&backend->priv->views_mutex);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]