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:
Ryan Lortie
2013-04-22 17:37:18 -04:00
parent 31fde567a9
commit ddb0ce1421
3 changed files with 18 additions and 2 deletions

View File

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