Should I chain up finalize?
- From: Peter Cai <newptcai gmail com>
- To: gtk-list gnome org
- Subject: Should I chain up finalize?
- Date: Fri, 23 Oct 2009 11:22:20 +0800
I found code like this in gio
static void
g_filter_input_stream_finalize (GObject *object)
{
GFilterInputStream *stream;
stream = G_FILTER_INPUT_STREAM (object);
g_object_unref (stream->base_stream);
G_OBJECT_CLASS (g_filter_input_stream_parent_class)->finalize (object);
}
It looks like I should also use
G_OBJECT_CLASS (xxxxx_parent_class)->finalize (object);
to chain up instance finalize in my code.
BUT, I found that it caused parent class's finalize called twice when unref.
So, should I or should I NOT chain dispose and finalize in my code?
BTW : I think this should be clarified in Gobject's tutorial.
--
look to the things around you,the immediate world around you, if you are alive,it will mean something to you ——Paul Strand
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]