summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-24 12:37:53 +0000
committerTravis Reitter <travis.reitter@collabora.co.uk>2014-03-27 15:18:46 -0700
commitad92c2a3a6408db165df59a0cc183643ff3f33a3 (patch)
treed72acae60dd052ecec95ad5b7e6c5d89aea82182
parentd582273308915f171d49966b1d1ac454a72d3fa8 (diff)
FolksTestDBus: flush and close connection before disposing of it
g_dbus_connection_dispose() sets connection->worker = NULL, which means any attempt to send a message will crash with a segfault. If anything still has a ref to the connection - in Folks, that's often a backend reffed by the IndividualAggregator - then it'll tend to assume that it's still usable. Attempts to send messages are guarded by a check whether the connection is closed, which we can use to avoid this. https://bugzilla.gnome.org/show_bug.cgi?id=726973
-rw-r--r--tests/lib/gtestdbus.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/lib/gtestdbus.c b/tests/lib/gtestdbus.c
index cca9435a..38895ff3 100644
--- a/tests/lib/gtestdbus.c
+++ b/tests/lib/gtestdbus.c
@@ -899,7 +899,11 @@ folks_test_dbus_down (FolksTestDBus *self)
connection = g_bus_get_sync (bus_type, NULL, NULL);
if (connection != NULL)
- g_dbus_connection_set_exit_on_close (connection, FALSE);
+ {
+ g_dbus_connection_set_exit_on_close (connection, FALSE);
+ g_dbus_connection_flush_sync (connection, NULL, NULL);
+ g_dbus_connection_close_sync (connection, NULL, NULL);
+ }
if (self->priv->bus_address != NULL)
stop_daemon (self);