Skip to content

Commit 4f1e199

Browse files
authored
fix memory leak of test_chunked_read (#54)
1 parent 0010e44 commit 4f1e199

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/testtools.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,13 @@ function test_chunked_read(Encoder, Decoder)
8282
data = mapfoldl(x->transcode(encoder, x), vcat, chunks, init=UInt8[])
8383
buffer = NoopStream(IOBuffer(data))
8484
ok = true
85-
local stream
8685
for chunk in chunks
8786
stream = TranscodingStream(Decoder(), buffer, stop_on_end=true)
8887
ok &= hash(read(stream)) == hash(chunk)
8988
ok &= eof(stream)
89+
close(stream)
9090
end
9191
Test.@test ok
92-
close(stream)
9392
end
9493
finalize(encoder)
9594
end

0 commit comments

Comments
 (0)