Only access node->data->instance when the node is instantiable.

Tue Jul  8 22:29:31 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtype.c (type_class_init_Wm): Only access node->data->instance
	when the node is instantiable.
This commit is contained in:
Soeren Sandmann 2003-07-08 20:12:05 +00:00 committed by Søren Sandmann Pedersen
parent 2d9b959c98
commit 6e2d715fd8
2 changed files with 15 additions and 6 deletions

View File

@ -1,3 +1,8 @@
Tue Jul 8 22:29:31 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtype.c (type_class_init_Wm): Only access node->data->instance
when the node is instantiable.
Tue Jul 8 14:55:27 2003 Owen Taylor <otaylor@redhat.com> Tue Jul 8 14:55:27 2003 Owen Taylor <otaylor@redhat.com>
* gtype.c (type_class_init_Wm): Initialize * gtype.c (type_class_init_Wm): Initialize

View File

@ -1585,12 +1585,16 @@ type_class_init_Wm (TypeNode *node,
TypeNode *pnode = lookup_type_node_I (pclass->g_type); TypeNode *pnode = lookup_type_node_I (pclass->g_type);
memcpy (class, pclass, pnode->data->class.class_size); memcpy (class, pclass, pnode->data->class.class_size);
if (node->is_instantiatable)
{
/* We need to initialize the private_size here rather than in /* We need to initialize the private_size here rather than in
* type_data_make_W() since the class init for the parent * type_data_make_W() since the class init for the parent
* class may have changed pnode->data->instance.private_size. * class may have changed pnode->data->instance.private_size.
*/ */
node->data->instance.private_size = pnode->data->instance.private_size; node->data->instance.private_size = pnode->data->instance.private_size;
} }
}
class->g_type = NODE_TYPE (node); class->g_type = NODE_TYPE (node);
G_WRITE_UNLOCK (&type_rw_lock); G_WRITE_UNLOCK (&type_rw_lock);