Skip to content

Commit

Permalink
Merge pull request #5 from pbrumm/fix/memory_leak_with_ctx
Browse files Browse the repository at this point in the history
checking if this fixes memory leak when garbage collection occurs
  • Loading branch information
didactic-drunk authored May 14, 2024
2 parents 4d914f4 + e749dea commit 6e63bfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/zstd/compress/io.cr
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,7 @@ class Zstd::Compress::IO < IO
write_loop Lib::ZstdEndDirective::ZstdEEnd

@io.close if @sync_close
ensure
@ctx.close
end
end
2 changes: 2 additions & 0 deletions src/zstd/decompress/io.cr
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,7 @@ class Zstd::Decompress::IO < ::IO
@closed = true

@io.close if @sync_close
ensure
@ctx.close
end
end

0 comments on commit 6e63bfc

Please sign in to comment.