On Mon, 2005-05-16 at 19:52 +0100, Ross Burton wrote: > On Mon, 2005-05-16 at 20:34 +0200, Alessandro Decina wrote: > > > The ->priv data was never freed when an EBookListener was destroyed, the > > > attached patch adds a dispose function to free it. > > why not use finalize? After dispose the instance should be still intact. Good point, attached patch is better. Ross -- Ross Burton mail: ross burtonini com jabber: ross burtonini com www: http://www.burtonini.com./ PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF
Index: addressbook/libebook/e-book-listener.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/addressbook/libebook/e-book-listener.c,v retrieving revision 1.16 diff -u -r1.16 e-book-listener.c --- addressbook/libebook/e-book-listener.c 4 May 2005 08:46:12 -0000 1.16 +++ addressbook/libebook/e-book-listener.c 16 May 2005 19:20:32 -0000 @@ -437,6 +437,17 @@ } static void +e_book_listener_finalize (GObject *object) +{ + EBookListener *listener = E_BOOK_LISTENER (object); + + g_free (listener->priv); + + if (G_OBJECT_CLASS (parent_class)->finalize) + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static void e_book_listener_class_init (EBookListenerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -472,6 +483,8 @@ epv->notifyWritable = impl_BookListener_report_writable; epv->notifyConnectionStatus = impl_BookListener_report_link_status; epv->notifyAuthRequired = impl_BookListener_report_auth_required; + + object_class->finalize = e_book_listener_finalize; } BONOBO_TYPE_FUNC_FULL (
Attachment:
signature.asc
Description: This is a digitally signed message part