[gtk+/gtk-3-10] GtkBuilder: Fall back to gtk_test_register_all_types if type lookup fails



commit 0f9ce285c55d9df2be87503f6a7abfbcaa30f0c9
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Oct 14 16:05:08 2013 +0200

    GtkBuilder: Fall back to gtk_test_register_all_types if type lookup fails
    
    This is important because the dlsym() approach can fail if gtk was
    loaded with RTLD_LOCAL.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710096

 gtk/gtkbuilder.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index 5e3af21..69ca4e6 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -254,6 +254,7 @@
 #include "gtktypebuiltins.h"
 #include "gtkwindow.h"
 #include "gtkicontheme.h"
+#include "gtktestutils.h"
 #include "deprecated/gtkstock.h"
 
 
@@ -454,7 +455,12 @@ gtk_builder_real_get_type_from_name (GtkBuilder  *builder,
   if (gtype != G_TYPE_INVALID)
     return gtype;
 
-  return _gtk_builder_resolve_type_lazily (type_name);
+  gtype = _gtk_builder_resolve_type_lazily (type_name);
+  if (gtype != G_TYPE_INVALID)
+    return gtype;
+
+  gtk_test_register_all_types ();
+  return g_type_from_name (type_name);
 }
 
 typedef struct


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