[gtksourceview] workaround deadlocks in type initialization



commit 924fee36062626841cbe05a644f0ce451deda51a
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 2bf317b..fd1b4fc 100644
--- a/gtksourceview/gtksourcefileloader.c
+++ b/gtksourceview/gtksourcefileloader.c
@@ -446,6 +446,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 e45cd9e..56fdf33 100644
--- a/gtksourceview/gtksourcefilesaver.c
+++ b/gtksourceview/gtksourcefilesaver.c
@@ -463,6 +463,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]