mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
Check for 0-sized private data. (#443869)
2007-06-14 Cody Russell <bratsche@gnome.org> * gobject/gtype.c (g_type_class_add_private): Check for 0-sized private data. (#443869) svn path=/trunk/; revision=5561
This commit is contained in:
committed by
Cody Russell
parent
71a9fa9879
commit
19086497ab
@@ -3483,6 +3483,8 @@ g_type_class_add_private (gpointer g_class,
|
||||
TypeNode *node = lookup_type_node_I (instance_type);
|
||||
gsize offset;
|
||||
|
||||
g_return_if_fail (private_size > 0);
|
||||
|
||||
if (!node || !node->is_instantiatable || !node->data || node->data->class.class != g_class)
|
||||
{
|
||||
g_warning ("cannot add private field to invalid (non-instantiatable) type '%s'",
|
||||
|
Reference in New Issue
Block a user