summaryrefslogtreecommitdiff
path: root/tests/dbus/text-respawn.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2009-01-28 10:27:29 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2009-01-28 10:27:29 +0000
commit5e3f547b948e4f9f36aa0154b5565494b3da0b22 (patch)
tree251e4c259fc8aee93f6119143c5d0a077b2d071d /tests/dbus/text-respawn.c
parent1f4242baa58082cc2e96f560682f67718005336a (diff)
tests: call tp_get_bus() earlier, to initialize specialized types
Instantiating a DBusGConnection (which is done by tp_get_bus()) is the only safe way to ensure that dbus-glib is initialized (see fd.o #13908 for why dbus_g_type_specialized_init() isn't safe). In principle, we need to do this initialization before creating TpBaseConnection subclasses. Previously, this was coincidentally avoided because Connection didn't actually use any specialized types, but the ConnectionError signal that will be in the next spec release introduces a specialized type. Mitigating factor: connection managers should all be using tp_run_connection_manager(), which already calls tp_get_bus().
Diffstat (limited to 'tests/dbus/text-respawn.c')
-rw-r--r--tests/dbus/text-respawn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/dbus/text-respawn.c b/tests/dbus/text-respawn.c
index f04045789..f2b5ee8cc 100644
--- a/tests/dbus/text-respawn.c
+++ b/tests/dbus/text-respawn.c
@@ -103,6 +103,7 @@ main (int argc,
g_type_init ();
/* tp_debug_set_flags ("all"); */
+ dbus = tp_dbus_daemon_new (tp_get_bus ());
service_conn = EXAMPLE_ECHO_CONNECTION (g_object_new (
EXAMPLE_TYPE_ECHO_CONNECTION,
@@ -117,7 +118,6 @@ main (int argc,
&name, &conn_path, &error), "");
MYASSERT_NO_ERROR (error);
- dbus = tp_dbus_daemon_new (tp_get_bus ());
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
MYASSERT_NO_ERROR (error);