[evolution-data-server] Bug 623703 - Reference counting error in Google backend



commit 2440b4744a2f12abfd1bd616a5e72a9faf879b96
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Aug 18 21:18:32 2010 -0400

    Bug 623703 - Reference counting error in Google backend
    
    e_book_backend_google_stop_book_view() was removing the given
    EDataBookView from an internal list and then unreferencing the view
    without verifying that the view was actually in the list.

 .../backends/google/e-book-backend-google.c        |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/backends/google/e-book-backend-google.c b/addressbook/backends/google/e-book-backend-google.c
index 826167c..40d242d 100644
--- a/addressbook/backends/google/e-book-backend-google.c
+++ b/addressbook/backends/google/e-book-backend-google.c
@@ -967,12 +967,15 @@ static void
 e_book_backend_google_stop_book_view (EBookBackend *backend, EDataBookView *bookview)
 {
 	EBookBackendGooglePrivate *priv = E_BOOK_BACKEND_GOOGLE (backend)->priv;
+	GList *link;
 
 	__debug__ (G_STRFUNC);
 
 	/* Remove the view from the list of active views */
-	priv->bookviews = g_list_remove (priv->bookviews, bookview);
-	e_data_book_view_unref (bookview);
+	if ((link = g_list_find (priv->bookviews, bookview)) != NULL) {
+		priv->bookviews = g_list_delete_link (priv->bookviews, link);
+		e_data_book_view_unref (bookview);
+	}
 
 	/* If there are no book views left, we can stop doing certain things, like refreshes */
 	if (!priv->bookviews)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]