We want freeing the returned stream to also free these underlying
objects. Compare tests/test-filters.c in the gmime 3.2.x source, which
uses this same idiom.
Thanks to James Troup for the report and the fix.
# there are more than 200 messages in this corpus
add_email_corpus lkml
test_begin_subtest "new doesn't run out of file descriptors with many gzipped files"
# there are more than 200 messages in this corpus
add_email_corpus lkml
test_begin_subtest "new doesn't run out of file descriptors with many gzipped files"
-test_subtest_known_broken
ulimit -n 200
gzip --recursive ${MAIL_DIR}
test_expect_success "notmuch new"
ulimit -n 200
gzip --recursive ${MAIL_DIR}
test_expect_success "notmuch new"
/* ignore filter id */
(void)g_mime_stream_filter_add ((GMimeStreamFilter *)gzstream, gzfilter);
/* ignore filter id */
(void)g_mime_stream_filter_add ((GMimeStreamFilter *)gzstream, gzfilter);
+ g_object_unref(gzfilter);
+ g_object_unref(file_stream);
return gzstream;
} else {
return file_stream;
return gzstream;
} else {
return file_stream;