ESourceRegistry: Work around GType deadlock.
authorMatthew Barnes <mbarnes@redhat.com>
Fri, 7 Sep 2012 11:40:09 +0000 (07:40 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Fri, 7 Sep 2012 11:40:09 +0000 (07:40 -0400)
Work around http://bugzilla.gnome.org/show_bug.cgi?id=683519
until GObject's type initialization deadlock issue is fixed.
Apparently only the synchronous instantiation is affected.

libedataserver/e-source-registry.c

index c9783d6..b5632cd 100644 (file)
 #define E_SETTINGS_DEFAULT_MEMO_LIST_KEY       "default-memo-list"
 #define E_SETTINGS_DEFAULT_TASK_LIST_KEY       "default-task-list"
 
+/* This forces the GType to be registered in a way that
+ * avoids a "statement with no effect" compiler warning.
+ * FIXME Use g_type_ensure() once we require GLib 2.34. */
+#define REGISTER_TYPE(type) \
+       (g_type_class_unref (g_type_class_ref (type)))
+
 typedef struct _AsyncContext AsyncContext;
 typedef struct _AuthContext AuthContext;
 typedef struct _SourceClosure SourceClosure;
@@ -1281,6 +1287,11 @@ ESourceRegistry *
 e_source_registry_new_sync (GCancellable *cancellable,
                             GError **error)
 {
+       /* XXX Work around http://bugzilla.gnome.org/show_bug.cgi?id=683519
+        *     until GObject's type initialization deadlock issue is fixed.
+        *     Apparently only the synchronous instantiation is affected. */
+       REGISTER_TYPE (G_TYPE_DBUS_CONNECTION);
+
        return g_initable_new (
                E_TYPE_SOURCE_REGISTRY,
                cancellable, error, NULL);