From 80b6ffc717cba1adb0522f3d9aa607a0366add8f Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Fri, 16 Jul 2004 06:37:58 +0000 Subject: [PATCH] apply patch by stefan Kost --- docs/reference/gobject/tut_howto.xml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/reference/gobject/tut_howto.xml b/docs/reference/gobject/tut_howto.xml index 98e8f87..75a8f9d 100644 --- a/docs/reference/gobject/tut_howto.xml +++ b/docs/reference/gobject/tut_howto.xml @@ -154,8 +154,21 @@ struct _MamanBar { MamanBarPrivate *priv; }; - The private structure is then defined in the .c file, instantiated in the object's XXX - function and destroyed in the object's XXX function. + The private structure is then defined in the .c file, instantiated in the object's + init function and destroyed in the object's finalize function. + +static void maman_bar_finalize(GObject *object) { + MamanBar *self = MAMAN_BAR (object); + ... + g_free (self->priv); +} + +static void maman_bar_init(GTypeInstance *instance, gpointer g_class) { + MamanBar *self = MAMAN_BAR (instance); + self->priv = g_new0(MamanBarPrivate,1); + ... +} + @@ -607,7 +620,7 @@ maman_bar_subtype_class_init (MamanBarSubTypeClass *klass) Chaining up - Chaining up is often loosely defined by the folowing set of conditions: + Chaining up is often loosely defined by the following set of conditions: Parent class A defines a public virtual method named foo and provides a default implementation. -- 2.7.4