From 61d764c54e907ded4ec672f6dc44c1f854afb041 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 26 Sep 2003 21:26:42 +0000 Subject: [PATCH] You can have instance_real_class_bsa be non-NULL, but still the class not Fri Sep 26 17:24:53 2003 Owen Taylor * gtype.c (g_type_instance_get_private): You can have instance_real_class_bsa be non-NULL, but still the class not be in the bsa. (Found by Kris Rietveld) --- gobject/ChangeLog | 6 ++++++ gobject/gtype.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gobject/ChangeLog b/gobject/ChangeLog index 5c781966f..a21ec5700 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -1,3 +1,9 @@ +Fri Sep 26 17:24:53 2003 Owen Taylor + + * gtype.c (g_type_instance_get_private): You can + have instance_real_class_bsa be non-NULL, but still + the class not be in the bsa. (Found by Kris Rietveld) + 2003-09-15 Matthias Clasen * glib-genmarshal.c (complete_out_arg): Don't generate code diff --git a/gobject/gtype.c b/gobject/gtype.c index 2c78542d3..1339b0644 100644 --- a/gobject/gtype.c +++ b/gobject/gtype.c @@ -3401,7 +3401,11 @@ g_type_instance_get_private (GTypeInstance *instance, * so figure the instances real class first */ if (instance_real_class_bsa) - class = instance_real_class_get (instance); + { + class = instance_real_class_get (instance); + if (!class) + class = instance->g_class; + } else class = instance->g_class;