diff options
author | Soeren Sandmann <sandmann@daimi.au.dk> | 2003-07-08 20:12:05 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2003-07-08 20:12:05 +0000 |
commit | 6e2d715fd8bf99dcd2076c3e316bf762e34bcb17 (patch) | |
tree | 13a62a4e2504c9473689cb304cade27d5d639a3a /gobject | |
parent | 2d9b959c98046b49629bb686653a919912a46564 (diff) |
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.
Diffstat (limited to 'gobject')
-rw-r--r-- | gobject/ChangeLog | 5 | ||||
-rw-r--r-- | gobject/gtype.c | 16 |
2 files changed, 15 insertions, 6 deletions
diff --git a/gobject/ChangeLog b/gobject/ChangeLog index a7fb859aa..c143adbf0 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -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> * gtype.c (type_class_init_Wm): Initialize diff --git a/gobject/gtype.c b/gobject/gtype.c index 320897c44..891053b6b 100644 --- a/gobject/gtype.c +++ b/gobject/gtype.c @@ -912,7 +912,7 @@ type_data_make_W (TypeNode *node, vtable_size += strlen (value_table->lcopy_format); vtable_size += 2; } - + if (node->is_instantiatable) /* carefull, is_instantiatable is also is_classed */ { data = g_malloc0 (sizeof (InstanceData) + vtable_size); @@ -1585,11 +1585,15 @@ type_class_init_Wm (TypeNode *node, TypeNode *pnode = lookup_type_node_I (pclass->g_type); memcpy (class, pclass, pnode->data->class.class_size); - /* We need to initialize the private_size here rather than in - * type_data_make_W() since the class init for the parent - * class may have changed pnode->data->instance.private_size. - */ - node->data->instance.private_size = pnode->data->instance.private_size; + + if (node->is_instantiatable) + { + /* We need to initialize the private_size here rather than in + * type_data_make_W() since the class init for the parent + * class may have changed pnode->data->instance.private_size. + */ + node->data->instance.private_size = pnode->data->instance.private_size; + } } class->g_type = NODE_TYPE (node); |