aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-show.c
diff options
context:
space:
mode:
authorGravatar Tomi Ollila <tomi.ollila@iki.fi>2011-12-13 20:18:48 +0200
committerGravatar David Bremner <bremner@debian.org>2011-12-15 07:38:06 -0400
commitff91aeedc170b15ea26c68e514b8279ca3ebd3b6 (patch)
tree87f46f899c0ad7137d27cec8dede964eb49af087 /notmuch-show.c
parented56fee6e5e8c114378f2d2def5395caab5d66a6 (diff)
notmuch: unref charset_filter to fix one memory leak
In my test case added g_object_unref(charset_filter) reduces memory consumption over 90% when 'notmuch show --format=text "*"' is executed (~11000 messages, RES ~330M -> ~25M).
Diffstat (limited to 'notmuch-show.c')
-rw-r--r--notmuch-show.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/notmuch-show.c b/notmuch-show.c
index 873a7c4c..8da3295e 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -471,9 +471,12 @@ show_text_part_content (GMimeObject *part, GMimeStream *stream_out)
/* This result can be NULL for things like "unknown-8bit".
* Don't set a NULL filter as that makes GMime print
* annoying assertion-failure messages on stderr. */
- if (charset_filter)
+ if (charset_filter) {
g_mime_stream_filter_add (GMIME_STREAM_FILTER (stream_filter),
charset_filter);
+ g_object_unref (charset_filter);
+ }
+
}
wrapper = g_mime_part_get_content_object (GMIME_PART (part));