mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +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
889096b1ea
commit
47bd02855f
@ -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>
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user