[gtksourceview/gnome-3-24] workaround deadlocks in type initialization



commit fb70858b230ebc60595dca103823f8c772ea974b
Author: Christian Hergert <chergert redhat com>
Date:   Fri Mar 17 13:35:14 2017 -0700

    workaround deadlocks in type initialization
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780216

 gtksourceview/gtksourcefileloader.c |    8 ++++++++
 gtksourceview/gtksourcefilesaver.c  |    8 ++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourcefileloader.c b/gtksourceview/gtksourcefileloader.c
index 0376b9b..aafbf85 100644
--- a/gtksourceview/gtksourcefileloader.c
+++ b/gtksourceview/gtksourcefileloader.c
@@ -447,6 +447,14 @@ gtk_source_file_loader_class_init (GtkSourceFileLoaderClass *klass)
                                                              G_PARAM_READWRITE |
                                                              G_PARAM_CONSTRUCT_ONLY |
                                                              G_PARAM_STATIC_STRINGS));
+
+       /* Due to potential deadlocks when registering types, we need to
+        * ensure the dependent private class GtkSourceBufferOutputStream
+        * has been registered up front.
+        *
+        * See https://bugzilla.gnome.org/show_bug.cgi?id=780216
+        */
+       g_type_ensure (GTK_SOURCE_TYPE_BUFFER_OUTPUT_STREAM);
 }
 
 static void
diff --git a/gtksourceview/gtksourcefilesaver.c b/gtksourceview/gtksourcefilesaver.c
index dd75e09..8109eda 100644
--- a/gtksourceview/gtksourcefilesaver.c
+++ b/gtksourceview/gtksourcefilesaver.c
@@ -464,6 +464,14 @@ gtk_source_file_saver_class_init (GtkSourceFileSaverClass *klass)
                                                             G_PARAM_READWRITE |
                                                             G_PARAM_CONSTRUCT |
                                                             G_PARAM_STATIC_STRINGS));
+
+       /* Due to potential deadlocks when registering types, we need to
+        * ensure the dependent private class GtkSourceBufferInputStream
+        * has been registered up front.
+        *
+        * See https://bugzilla.gnome.org/show_bug.cgi?id=780216
+        */
+       g_type_ensure (GTK_SOURCE_TYPE_BUFFER_INPUT_STREAM);
 }
 
 static void


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