From: Ryan Lortie Date: Mon, 22 Apr 2013 22:32:05 +0000 (-0400) Subject: Revert "GObject: prevent installing properties after init" X-Git-Tag: 2.37.0~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8438f98e2d274b57008eddcb86df3f63e166933;p=platform%2Fupstream%2Fglib.git Revert "GObject: prevent installing properties after init" This reverts commit ddb0ce14215cd62c7a2497d6cf9f2ea63c40ebb5. Colin's smoke testing has found issues in at least gjs and gnome-settings-daemon. We'll need to see if we can address those. --- diff --git a/gobject/gobject.c b/gobject/gobject.c index dab782b..4472254 100644 --- a/gobject/gobject.c +++ b/gobject/gobject.c @@ -540,10 +540,8 @@ g_object_class_install_property (GObjectClass *class, g_return_if_fail (G_IS_PARAM_SPEC (pspec)); if (CLASS_HAS_DERIVED_CLASS (class)) - g_error ("Attempt to add property %s::%s to class after it was derived", G_OBJECT_CLASS_NAME (class), pspec->name); - - if (!g_type_is_in_init (G_OBJECT_CLASS_TYPE (class))) - g_error ("Attempt to add property %s::%s after class was initialised", G_OBJECT_CLASS_NAME (class), pspec->name); + g_error ("Attempt to add property %s::%s to class after it was derived", + G_OBJECT_CLASS_NAME (class), pspec->name); class->flags |= CLASS_HAS_PROPS_FLAG; @@ -655,9 +653,6 @@ g_object_class_install_properties (GObjectClass *oclass, g_error ("Attempt to add properties to %s after it was derived", G_OBJECT_CLASS_NAME (oclass)); - if (!g_type_is_in_init (G_OBJECT_CLASS_TYPE (oclass))) - g_error ("Attempt to add properties %s after it was initialised", G_OBJECT_CLASS_NAME (oclass)); - oclass_type = G_OBJECT_CLASS_TYPE (oclass); parent_type = g_type_parent (oclass_type); diff --git a/gobject/gtype-private.h b/gobject/gtype-private.h index d9e31e4..5c415e5 100644 --- a/gobject/gtype-private.h +++ b/gobject/gtype-private.h @@ -72,7 +72,6 @@ void _g_closure_invoke_va (GClosure *closure, int n_params, GType *param_types); -gboolean g_type_is_in_init (GType type); G_END_DECLS diff --git a/gobject/gtype.c b/gobject/gtype.c index 3541d90..9cdb77f 100644 --- a/gobject/gtype.c +++ b/gobject/gtype.c @@ -4646,13 +4646,3 @@ 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; -}