mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 03:02:10 +01:00
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:
parent
c6383da427
commit
62004950ad
@ -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>
|
2004-07-21 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib-genmarshal.c (put_marshal_value_getters): Use the
|
* glib-genmarshal.c (put_marshal_value_getters): Use the
|
||||||
|
@ -3585,6 +3585,12 @@ g_type_instance_get_private (GTypeInstance *instance,
|
|||||||
parent_node = lookup_type_node_I (NODE_PARENT_TYPE (private_node));
|
parent_node = lookup_type_node_I (NODE_PARENT_TYPE (private_node));
|
||||||
g_assert (parent_node->data && parent_node->data->common.ref_count);
|
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);
|
offset += ALIGN_STRUCT (parent_node->data->instance.private_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user