From: short <> Date: Tue, 9 Sep 2003 18:50:15 +0000 (+0000) Subject: Fixed 'finalize' to proper pass finalization to its parent class finalizer. X-Git-Tag: captive-0_9~96 X-Git-Url: http://git.jankratochvil.net/?a=commitdiff_plain;h=54406506580ffaf192fc243840de215d8d974b04;p=captive.git Fixed 'finalize' to proper pass finalization to its parent class finalizer. Fixed reference counting by SharedCacheMap 'map' PrivateBcbMap. --- diff --git a/src/libcaptive/cc/privatebcbmap.c b/src/libcaptive/cc/privatebcbmap.c index b3c20e7..26544e3 100644 --- a/src/libcaptive/cc/privatebcbmap.c +++ b/src/libcaptive/cc/privatebcbmap.c @@ -49,7 +49,7 @@ CaptiveSharedCacheMapObject *captive_shared_cache_map_object; if ((captive_shared_cache_map_object=captive_private_bcb_object->SharedCacheMap)) { g_assert(captive_shared_cache_map_object->map==captive_private_bcb_map_object); captive_shared_cache_map_object->map=NULL; - g_object_unref(captive_shared_cache_map_object); + g_object_unref(captive_shared_cache_map_object); /* 'map' disconnected. */ } G_OBJECT_CLASS(captive_private_bcb_map_object_parent_class)->finalize((GObject *)captive_private_bcb_map_object); @@ -60,7 +60,7 @@ static void captive_private_bcb_map_object_class_init(CaptivePrivateBcbMapObject { GObjectClass *gobject_class=G_OBJECT_CLASS(class); - captive_private_bcb_map_object_parent_class=g_type_class_ref(G_TYPE_OBJECT); + captive_private_bcb_map_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); gobject_class->finalize=(void (*)(GObject *object))captive_private_bcb_map_object_finalize; } @@ -109,6 +109,7 @@ CaptivePrivateBcbMapObject *captive_private_bcb_map_object; g_assert(captive_shared_cache_map_object->map==NULL); captive_shared_cache_map_object->map=captive_private_bcb_map_object; + g_object_ref(captive_shared_cache_map_object); /* 'map' connected. */ return captive_private_bcb_map_object; }