[PATCH] _notmuch_message_index_file: unref (free) address lists from gmime.

2012-12-10 Thread david
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.
---
 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


[PATCH] _notmuch_message_index_file: unref (free) address lists from gmime.

2012-12-10 Thread da...@tethera.net
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.
---
 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



[PATCH] _notmuch_message_index_file: unref (free) address lists from gmime.

2012-12-11 Thread Tomi Ollila
On Tue, Dec 11 2012, david at 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 at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] _notmuch_message_index_file: unref (free) address lists from gmime.

2012-12-24 Thread Austin Clements
This patch LGTM.

On Mon, 10 Dec 2012, david at 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.
> ---
>  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 at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] _notmuch_message_index_file: unref (free) address lists from gmime.

2012-12-24 Thread David Bremner
david at tethera.net writes:

> 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).
>

pushed, 

d


Re: [PATCH] _notmuch_message_index_file: unref (free) address lists from gmime.

2012-12-10 Thread Tomi Ollila
On Tue, Dec 11 2012, da...@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
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] _notmuch_message_index_file: unref (free) address lists from gmime.

2012-12-24 Thread Austin Clements
This patch LGTM.

On Mon, 10 Dec 2012, da...@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.
> ---
>  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
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] _notmuch_message_index_file: unref (free) address lists from gmime.

2012-12-24 Thread David Bremner
da...@tethera.net writes:

> 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).
>

pushed, 

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch