mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-21 08:28:53 +02:00
GObject: prevent installing properties after init
GObject has previously allowed installing properties after class_init has finished running. This means that you could install some of your own properties on G_TYPE_OBJECT, for example, although they wouldn't have worked properly. Prevent this from happening. Require that all properties are installed by the time class_init has finished. Complaints go to this bug: https://bugzilla.gnome.org/show_bug.cgi?id=698614
This commit is contained in:
@@ -4646,3 +4646,13 @@ g_type_ensure (GType type)
|
||||
if (G_UNLIKELY (type == (GType)-1))
|
||||
g_error ("can't happen");
|
||||
}
|
||||
|
||||
gboolean
|
||||
g_type_is_in_init (GType type)
|
||||
{
|
||||
TypeNode *node;
|
||||
|
||||
node = lookup_type_node_I (type);
|
||||
|
||||
return node->data->class.init_state != INITIALIZED;
|
||||
}
|
||||
|
Reference in New Issue
Block a user