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-17 15:43:53 +0000
commit05fa939078a92bf589bdf80cc42de1711c0cac25 (patch)
treea6efb66693bdec9d6a19240df05e5d0c116a8e21
parent256dd21d63924a1e4d2e23f20a29313210727a59 (diff)
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");