DBus: call g_type_init() as part of init
authorSam Thursfield <samthursfield@codethink.co.uk>
Thu, 7 Jul 2011 10:42:45 +0000 (11:42 +0100)
committerSam Thursfield <samthursfield@codethink.co.uk>
Thu, 7 Jul 2011 10:42:45 +0000 (11:42 +0100)
libmoonshot/libmoonshot-dbus.c

index ca76000..b2a62d3 100644 (file)
@@ -158,8 +158,13 @@ static DBusGProxy *get_dbus_proxy (MoonshotError **error)
 
     g_static_mutex_lock (&init_lock);
 
-    if (dbus_proxy == NULL)
+    if (dbus_proxy == NULL) {
+        /* Make sure GObject is initialised, in case we are the only user
+         * of GObject in the process
+         */
+        g_type_init ();
         dbus_proxy = dbus_connect (error);
+    }
 
     if (dbus_proxy != NULL)
         g_object_ref (dbus_proxy);