[evolution-data-server/gnome-3-8] EBookClient: Use G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED for close().



commit b4bec35511b7fe811eb544be9c8b05e92f230e69
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Apr 2 09:53:08 2013 -0400

    EBookClient: Use G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED for close().
    
    Invoke the close() method without a callback function so the server
    knows not to reply.  EBookClient tests that use GTestDBus generally
    close their GDBusConnection immediately after disposing EBookClient,
    and because we call close() asynchronously the server sometimes has
    no chance to reply before the GDBusConnection closes, resulting in
    a spurious console warning during the test.
    
    (cherry picked from commit c9a29823124717b649c6013268ff904152240a57)

 addressbook/libebook/e-book-client.c |   24 ++++--------------------
 1 files changed, 4 insertions(+), 20 deletions(-)
---
diff --git a/addressbook/libebook/e-book-client.c b/addressbook/libebook/e-book-client.c
index b0baea5..e7cbb1a 100644
--- a/addressbook/libebook/e-book-client.c
+++ b/addressbook/libebook/e-book-client.c
@@ -494,22 +494,6 @@ book_client_name_vanished_cb (GDBusConnection *connection,
 }
 
 static void
-book_client_close_cb (GObject *source_object,
-                      GAsyncResult *result,
-                      gpointer user_data)
-{
-       GError *error = NULL;
-
-       e_dbus_address_book_call_close_finish (
-               E_DBUS_ADDRESS_BOOK (source_object), result, &error);
-
-       if (error != NULL) {
-               g_warning ("%s: %s", G_STRFUNC, error->message);
-               g_error_free (error);
-       }
-}
-
-static void
 book_client_dispose (GObject *object)
 {
        EBookClientPrivate *priv;
@@ -531,11 +515,11 @@ book_client_dispose (GObject *object)
        }
 
        if (priv->dbus_proxy != NULL) {
-               /* Call close() asynchronously
-                * so we don't block dispose(). */
+               /* Call close() asynchronously so we don't block dispose().
+                * Also omit a callback function, so the GDBusMessage uses
+                * G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED. */
                e_dbus_address_book_call_close (
-                       priv->dbus_proxy, NULL,
-                       book_client_close_cb, NULL);
+                       priv->dbus_proxy, NULL, NULL, NULL);
                g_object_unref (priv->dbus_proxy);
                priv->dbus_proxy = NULL;
        }


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