[gtk+] GtkBuilder: Fall back to gtk_test_register_all_types if type lookup fails
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkBuilder: Fall back to gtk_test_register_all_types if type lookup fails
- Date: Wed, 16 Oct 2013 01:41:44 +0000 (UTC)
commit 07eafbaaa88ded2d57b5696c842dbb7059f05434
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 38d71f1..b76931e 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"
@@ -455,7 +456,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]