Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D3491431FAF for ; Mon, 10 Dec 2012 20:55:35 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9WDbOVWpV-3P for ; Mon, 10 Dec 2012 20:55:35 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 43222431FAE for ; Mon, 10 Dec 2012 20:55:35 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 3487D10007E; Tue, 11 Dec 2012 06:55:31 +0200 (EET) From: Tomi Ollila To: david@tethera.net, notmuch@notmuchmail.org Subject: Re: [PATCH] _notmuch_message_index_file: unref (free) address lists from gmime. In-Reply-To: <1355196820-29734-1-git-send-email-david@tethera.net> References: <1355188740-6663-1-git-send-email-david@tethera.net> <1355196820-29734-1-git-send-email-david@tethera.net> User-Agent: Notmuch/0.14+116~g29fcdb5 (http://notmuchmail.org) Emacs/24.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain Cc: David Bremner X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 04:55:36 -0000 On Tue, Dec 11 2012, david@tethera.net wrote: > From: David Bremner > > Apparently as of GMime 2.4, you don't need to call > internet_address_list_destroy anymore, but you still need to call > g_object_unref (from the GMime Changelog). > > On the medium performance corpus, valgrind shows "possibly lost" > leakage in "notmuch new" dropping from 7M to 300k. > --- LGTM. Tomi > lib/index.cc | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/lib/index.cc b/lib/index.cc > index da0e6ce..a2edd6d 100644 > --- a/lib/index.cc > +++ b/lib/index.cc > @@ -484,12 +484,18 @@ mboxes is deprecated and may be removed in the future.\n", filename); > } > > from = g_mime_message_get_sender (mime_message); > - addresses = internet_address_list_parse_string (from); > > - _index_address_list (message, "from", addresses); > + addresses = internet_address_list_parse_string (from); > + if (addresses) { > + _index_address_list (message, "from", addresses); > + g_object_unref (addresses); > + } > > addresses = g_mime_message_get_all_recipients (mime_message); > - _index_address_list (message, "to", addresses); > + if (addresses) { > + _index_address_list (message, "to", addresses); > + g_object_unref (addresses); > + } > > subject = g_mime_message_get_subject (mime_message); > _notmuch_message_gen_terms (message, "subject", subject); > -- > 1.7.10.4 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch