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



commit 23215305a7c63e1e30692e9b96c348571370c9eb
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Apr 2 10:25:50 2013 -0400

    ECalClient: 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.  ECalClient tests that use GTestDBus generally
    close their GDBusConnection immediately after disposing ECalClient,
    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 2535427ac2fc516b0caa2ff4d4ef1340484adf05)

 calendar/libecal/e-cal-client.c |   24 ++++--------------------
 1 files changed, 4 insertions(+), 20 deletions(-)
---
diff --git a/calendar/libecal/e-cal-client.c b/calendar/libecal/e-cal-client.c
index bd85c50..8f8d8e3 100644
--- a/calendar/libecal/e-cal-client.c
+++ b/calendar/libecal/e-cal-client.c
@@ -711,22 +711,6 @@ cal_client_name_vanished_cb (GDBusConnection *connection,
 }
 
 static void
-cal_client_close_cb (GObject *source_object,
-                     GAsyncResult *result,
-                     gpointer user_data)
-{
-       GError *error = NULL;
-
-       e_dbus_calendar_call_close_finish (
-               E_DBUS_CALENDAR (source_object), result, &error);
-
-       if (error != NULL) {
-               g_warning ("%s: %s", G_STRFUNC, error->message);
-               g_error_free (error);
-       }
-}
-
-static void
 cal_client_set_source_type (ECalClient *cal_client,
                             ECalClientSourceType source_type)
 {
@@ -810,11 +794,11 @@ cal_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_calendar_call_close (
-                       priv->dbus_proxy, NULL,
-                       cal_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]