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:33:05 +00:00 committed by Matthias Clasen
parent c6383da427
commit 62004950ad
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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

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