[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

Austin Clements amdragon at MIT.EDU
Sun Dec 4 11:26:36 PST 2011


Thanks for the review.  A new version is on its way...

Quoth Jani Nikula on Nov 29 at  9:11 pm:
> > +    mctx->stream = g_mime_stream_file_new (mctx->file);
> 
> AFAICT the GMimeStreamFile object owns the FILE * pointer now, and
> closes it later. Calling fclose() on it in _mime_node_context_free()
> would be undefined behaviour. But please don't just take my word for it.

The next line tells GMime not to close the stream on its own.

Though, while I believe the code is correct, I'm not sure why we can't
just let GMime close the stream and remove our fclose.  The original
code for this was introduced in 357aba3e (along with most of the code
in show-message.c) with the cryptic comment that otherwise GMime would
close stdout.  Since I'd rather not regress some bug I don't
understand, I'll leave the code the way it is.

> > +    g_mime_stream_file_set_owner (GMIME_STREAM_FILE (mctx->stream), FALSE);


More information about the notmuch mailing list