[next] telepathy-glib: tests/dbus/disconnection: close connection before emitting signal

Simon McVittie smcv at kemper.freedesktop.org
Tue Mar 18 05:45:05 PDT 2014


Module: telepathy-glib
Branch: next
Commit: 05fa939078a92bf589bdf80cc42de1711c0cac25
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=05fa939078a92bf589bdf80cc42de1711c0cac25

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Fri Mar 14 13:25:19 2014 +0000

tests/dbus/disconnection: close connection before emitting signal

dbus-glib does the actual I/O in the main thread, but we defer signal
processing to an idle. The close is not deferred in this way, so the
DBusGProxy will be marked as destroyed before the idle processes the
signal, and the signal is not received.

GDBus does all of its actual I/O on another thread, and defers
everything to an idle, so closing the connection just appends a "closed"
event to the queue, where it appears *after* the signal, and the signal
is received before we process it.

---

 tests/dbus/disconnection.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/dbus/disconnection.c b/tests/dbus/disconnection.c
index edf2dfe..034da73 100644
--- a/tests/dbus/disconnection.c
+++ b/tests/dbus/disconnection.c
@@ -335,15 +335,15 @@ main (int argc,
       destroy_user_data, (GObject *) f->proxies[TEST_A], &error_out);
   g_assert_no_error (error_out);
 
+  g_message ("Dropping private D-Bus connection");
+  drop_private_connection ();
+
   g_message ("Emitting signal");
   empty_asv = tp_asv_new (NULL, NULL);
   tp_svc_dbus_properties_emit_properties_changed (f->cd_service,
       TP_IFACE_CHANNEL_DISPATCHER, empty_asv, NULL);
   g_hash_table_unref (empty_asv);
 
-  g_message ("Dropping private D-Bus connection");
-  drop_private_connection ();
-
   /* wait for everything to happen */
   g_message ("Running main loop");
 



More information about the telepathy-commits mailing list