mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-16 21:50:34 +00:00
GtkBuilder: Ensure types are fully initialized
Just calling get_type() does not ensure that the signals, properties and everything else gets set up properly. Ensure it is, by calling g_type_class_ref() before using the type. This fixes the testcase added in the previous commit.
This commit is contained in:
parent
1153ea86ed
commit
6de6656d1f
@ -2275,10 +2275,17 @@ GType
|
||||
gtk_builder_get_type_from_name (GtkBuilder *builder,
|
||||
const gchar *type_name)
|
||||
{
|
||||
GType type;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_BUILDER (builder), G_TYPE_INVALID);
|
||||
g_return_val_if_fail (type_name != NULL, G_TYPE_INVALID);
|
||||
|
||||
return GTK_BUILDER_GET_CLASS (builder)->get_type_from_name (builder, type_name);
|
||||
type = GTK_BUILDER_GET_CLASS (builder)->get_type_from_name (builder, type_name);
|
||||
|
||||
if (G_TYPE_IS_CLASSED (type))
|
||||
g_type_class_unref (g_type_class_ref (type));
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
GQuark
|
||||
|
Loading…
Reference in New Issue
Block a user