From f5db214e8b64eaa1f4735628828449fdcf8b83de Mon Sep 17 00:00:00 2001 From: kristen1980 Date: Fri, 21 Apr 2017 15:54:10 -0600 Subject: [PATCH] Close converter --- reader.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reader.go b/reader.go index 2835ce6..676f9a5 100644 --- a/reader.go +++ b/reader.go @@ -18,7 +18,9 @@ func NewReader(source io.Reader, fromEncoding string, toEncoding string) (*Reade converter, err := NewConverter(fromEncoding, toEncoding) if err == nil { - return NewReaderFromConverter(source, converter), err + reader := iconv.NewReaderFromConverter(source, converter) + converter.Close() + return reader, err } // return the error