[evolution-data-server] Fix calls of e_data_book_view_unref



commit b14e3c3d8e08264fbec62db89751dee1facd636f
Author: Milan Crha <mcrha redhat com>
Date:   Wed Sep 1 11:43:06 2010 +0200

    Fix calls of e_data_book_view_unref

 .../backends/groupwise/e-book-backend-groupwise.c  |    1 +
 .../backends/webdav/e-book-backend-webdav.c        |    9 +--------
 2 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/addressbook/backends/groupwise/e-book-backend-groupwise.c b/addressbook/backends/groupwise/e-book-backend-groupwise.c
index 1af567f..f06c481 100644
--- a/addressbook/backends/groupwise/e-book-backend-groupwise.c
+++ b/addressbook/backends/groupwise/e-book-backend-groupwise.c
@@ -2393,6 +2393,7 @@ book_view_thread (gpointer data)
 	default :
 		break;
 	}
+	e_data_book_view_unref (book_view);
 	return NULL;
 }
 
diff --git a/addressbook/backends/webdav/e-book-backend-webdav.c b/addressbook/backends/webdav/e-book-backend-webdav.c
index 84bfd74..bff0879 100644
--- a/addressbook/backends/webdav/e-book-backend-webdav.c
+++ b/addressbook/backends/webdav/e-book-backend-webdav.c
@@ -854,23 +854,17 @@ download_contacts(EBookBackendWebdav *webdav, EFlag *running,
 	if (status == 401 || status == 407) {
 		g_object_unref(message);
 		g_free (new_ctag);
-		if (book_view)
-			e_data_book_view_unref(book_view);
 		return webdav_handle_auth_request (webdav);
 	}
 	if (status != 207) {
 		g_object_unref(message);
 		g_free (new_ctag);
-		if (book_view)
-			e_data_book_view_unref(book_view);
 		return e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR, "PROPFIND on webdav failed with HTTP status %d", status);
 	}
 	if (message->response_body == NULL) {
 		g_warning("No response body in webdav PROPFIND result");
 		g_object_unref(message);
 		g_free (new_ctag);
-		if (book_view)
-			e_data_book_view_unref(book_view);
 		return e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR, "No response body in webdav PROPFIND result");
 	}
 
@@ -979,10 +973,9 @@ book_view_thread(gpointer data)
 
 	error = download_contacts (webdav, closure->running, book_view);
 
-	e_data_book_view_unref(book_view);
-
 	/* report back status if query wasn't aborted */
 	e_data_book_view_notify_complete (book_view, error);
+	e_data_book_view_unref (book_view);
 
 	if (error)
 		g_error_free (error);



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