Re: Patch: better implementation for "dispose" in TnyCamelAccount and TnyCamelStoreAccount
- From: Philip Van Hoof <spam pvanhoof be>
- To: José Dapena Paz <jdapena igalia com>
- Cc: tinymail-devel-list <tinymail-devel-list gnome org>
- Subject: Re: Patch: better implementation for "dispose" in TnyCamelAccount and TnyCamelStoreAccount
- Date: Thu, 23 Jul 2009 10:21:58 +0200
On Tue, 2009-07-21 at 18:30 +0200, José Dapena Paz wrote:
> tatic void
> +tny_camel_account_dispose (GObject *object)
> +{
> + TnyCamelAccount *self = (TnyCamelAccount *)object;
> + TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE
> (self);
> + CamelException ex = CAMEL_EXCEPTION_INITIALISER;
> +
> + if (priv->service && CAMEL_IS_SERVICE (priv->service))
> + {
> + priv->service->connecting = NULL;
> + priv->service->disconnecting = NULL;
> + priv->service->reconnecter = NULL;
> + priv->service->reconnection = NULL;
> + camel_service_disconnect (CAMEL_SERVICE
> (priv->service), FALSE, &ex);
You are leaking and not handling ex here
> + }
> +
> + if (priv->session) {
> + _tny_session_camel_unregister_account (priv->session,
> (TnyCamelAccount*) object);
> + camel_object_unref (priv->session);
> + priv->session = NULL;
> + }
> + _tny_camel_account_start_camel_operation (self, NULL, NULL,
> NULL);
> + _tny_camel_account_stop_camel_operation (self);
> +
> + (*parent_class->dispose) (object);
> +
> + return;
> +}
--
Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
http://pvanhoof.be/blog
http://codeminded.be
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]