[evolution-data-server/openismus-work-3-8: 30/43] EBookBackend: Fixed ref-counting bug in e_book_backend_set_locale()



commit b43cb24ff8e80d61a0e8c2e933d45721ad320270
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Sat Nov 30 03:11:19 2013 +0900

    EBookBackend: Fixed ref-counting bug in e_book_backend_set_locale()

 addressbook/libedata-book/e-book-backend.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index c73da34..955ccc4 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -1222,17 +1222,19 @@ e_book_backend_set_locale (EBookBackend *backend,
                           GCancellable *cancellable,
                           GError      **error)
 {
+       /* If the backend does not support locales, just happily return */
+       gboolean success = TRUE;
+
        g_return_val_if_fail (E_IS_BOOK_BACKEND (backend), FALSE);
 
        g_object_ref (backend);
 
        if (E_BOOK_BACKEND_GET_CLASS (backend)->set_locale)
-               return (* E_BOOK_BACKEND_GET_CLASS (backend)->set_locale) (backend, locale,
-                                                                          cancellable, error);
+               success = (* E_BOOK_BACKEND_GET_CLASS (backend)->set_locale) (backend, locale,
+                                                                             cancellable, error);
        g_object_unref (backend);
 
-       /* Backend does not support locales, just happily return */
-       return TRUE;
+       return success;
 }
 
 /**


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