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
This commit is contained in:
Alexander Larsson 2013-10-14 16:05:08 +02:00 committed by Matthias Clasen
parent c4c11a165d
commit 07eafbaaa8

View File

@ -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