Re: [PATCH] resubmission for the add-tny_camel_send_queue_new_with_folders() patch



Approved and committed

Thanks

On Sun, 2008-10-26 at 17:21 +0100, Martin Bonnin wrote:
> 
> 
> 2008/10/26 Philip Van Hoof <spam pvanhoof be>
>         On Sun, 2008-10-26 at 17:01 +0100, Martin Bonnin wrote:
>         >
>         > +TnySendQueue*
>         > +tny_camel_send_queue_new_with_folders
>         (TnyCamelTransportAccount
>         > *trans_account, TnyFolder *outbox, TnyFolder *sentbox)
>         > +{
>         > +       TnyCamelSendQueue *self = g_object_new
>         > (TNY_TYPE_CAMEL_SEND_QUEUE, NULL);
>         > +       TnyCamelSendQueuePriv *priv =
>         TNY_CAMEL_SEND_QUEUE_GET_PRIVATE
>         > (self);
>         > +
>         > +       g_assert (TNY_IS_CAMEL_TRANSPORT_ACCOUNT
>         (trans_account));
>         > +       priv->outbox_cache  = g_object_ref(outbox);
>         > +       priv->sentbox_cache = g_object_ref(sentbox);
>         
>         
>         You are leaking the existing outbox_cache and sentbox_cache
>         here.
>         
>         Add these in front of the lines:
>         
>          if (priv->sentbox_cache)
>                    g_object_unref (priv->sentbox_cache);
>          if (priv->outbox_cache)
>                    g_object_unref (priv->outbox_cache);
>         
>         It's not likely that they'll be filled in,
> 
> Yes, the cache folders are null just after object creation.
>  
> 
>         but it's good practice
>         nonetheless to do this.
> 
> Ok, attached the revised patch
> 
> -- 
> Martin
> 
> 
> 
-- 
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]