Catch cases of forgotten g_type_add_private(). (#148368, Tommi Komulainen)

2004-07-28  Matthias Clasen  <mclasen@redhat.com>

	* gtype.c (g_type_instance_get_private): Catch cases of
	forgotten g_type_add_private().  (#148368, Tommi Komulainen)
This commit is contained in:
Matthias Clasen 2004-07-28 15:32:07 +00:00 committed by Matthias Clasen
parent 889096b1ea
commit 47bd02855f
2 changed files with 12 additions and 1 deletions

View File

@ -1,7 +1,12 @@
2004-07-28 Matthias Clasen <mclasen@redhat.com>
* gtype.c (g_type_instance_get_private): Catch cases of
forgotten g_type_add_private(). (#148368, Tommi Komulainen)
2004-07-21 Matthias Clasen <mclasen@redhat.com>
* glib-genmarshal.c (put_marshal_value_getters): Use the
correct fields for enums and flags. (#145015,Tommi Komulainen)
correct fields for enums and flags. (#145015, Tommi Komulainen)
Sun Jul 18 18:03:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>

View File

@ -3585,6 +3585,12 @@ g_type_instance_get_private (GTypeInstance *instance,
parent_node = lookup_type_node_I (NODE_PARENT_TYPE (private_node));
g_assert (parent_node->data && parent_node->data->common.ref_count);
if (G_UNLIKELY (private_node->data->instance.private_size == parent_node->data->instance.private_size))
{
g_warning ("g_type_get_private() requires a prior call to g_type_add_private()");
return NULL;
}
offset += ALIGN_STRUCT (parent_node->data->instance.private_size);
}