From 130b1b00ece4ec57b8d0fcfcee1bdf508d709736 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 10 Mar 2014 12:45:17 -0400 Subject: Don't close base stream when destroying a CamelFilterOutputStream. GFilterOutputStream, from which CamelFilterOutputStream is derived, defaults to closing its base stream when the instance is finalized. That makes sense in the general case, but CamelFilterOutputStreams are usually temporary wrappers on a more permanent base stream, so we need to remember to override the default "close-base-stream" property value. I was tempted to just make CamelFilterOutputStream override the default automatically, but I decided against it because my long term plan is to drop CamelFilterOutputStream for GConverterOutputStream which also does not override the "close-base-stream" default. The closer the semantics of the two classes match, the easier porting will be in the future. --- em-format/e-mail-formatter-quote-text-html.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'em-format/e-mail-formatter-quote-text-html.c') diff --git a/em-format/e-mail-formatter-quote-text-html.c b/em-format/e-mail-formatter-quote-text-html.c index 5ae94f7313..f6a47a9ab2 100644 --- a/em-format/e-mail-formatter-quote-text-html.c +++ b/em-format/e-mail-formatter-quote-text-html.c @@ -72,6 +72,8 @@ emqfe_text_html_format (EMailFormatterExtension *extension, filter = e_mail_stripsig_filter_new (FALSE); temp_stream = camel_filter_output_stream_new ( filtered_stream, filter); + g_filter_output_stream_set_close_base_stream ( + G_FILTER_OUTPUT_STREAM (temp_stream), FALSE); g_object_unref (filtered_stream); filtered_stream = temp_stream; g_object_unref (filter); -- cgit v1.2.3