[evolution-data-server] ESourceRegistry: Work around GType deadlock.



commit 6c4c1c6a1f40a6873be954a0b9d770e31726bd50
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Sep 7 07:40:09 2012 -0400

    ESourceRegistry: Work around GType deadlock.
    
    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 |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libedataserver/e-source-registry.c b/libedataserver/e-source-registry.c
index c9783d6..b5632cd 100644
--- a/libedataserver/e-source-registry.c
+++ b/libedataserver/e-source-registry.c
@@ -87,6 +87,12 @@
 #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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]