We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10b3387 commit c97ed5aCopy full SHA for c97ed5a
lib/zip/bzip2/libbz2.rb
@@ -7,9 +7,9 @@
7
module Zip
8
module Bzip2
9
class Libbz2 #:nodoc:
10
- def self.finalizer
+ def self.finalizer(stream)
11
lambda do |_id|
12
- decompress_end
+ FFI::Libbz2::BZ2_bzDecompressEnd(stream)
13
end
14
15
private_class_method :finalizer
@@ -32,7 +32,7 @@ def decompress_init!(small = false)
32
result = FFI::Libbz2::BZ2_bzDecompressInit(@stream, 0, small ? 1 : 0)
33
check_error(result)
34
35
- ObjectSpace.define_finalizer(self, self.class.send(:finalizer))
+ ObjectSpace.define_finalizer(self, self.class.send(:finalizer, @stream))
36
37
true
38
0 commit comments