summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-14 13:25:19 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-14 19:01:13 +0000
commit6e46788f1cc441604d61c562ce23dbe1cc9e2b3a (patch)
tree9cd645310be00e28e4e9615a27c323cbe0fc3fd1
parent96e9c07c75d003b97beb5f253b6c3f3c4381d2c2 (diff)
downloadtelepathy-glib-6e46788f1cc441604d61c562ce23dbe1cc9e2b3a.tar.gz
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.
-rw-r--r--tests/dbus/disconnection.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/dbus/disconnection.c b/tests/dbus/disconnection.c
index edf2dfe44..034da739f 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");