Skip to content

Commit c97ed5a

Browse files
committed
Fix the Libbz2::finalizer method.
As a class method this was originally calling out to an instance method.
1 parent 10b3387 commit c97ed5a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/zip/bzip2/libbz2.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
module Zip
88
module Bzip2
99
class Libbz2 #:nodoc:
10-
def self.finalizer
10+
def self.finalizer(stream)
1111
lambda do |_id|
12-
decompress_end
12+
FFI::Libbz2::BZ2_bzDecompressEnd(stream)
1313
end
1414
end
1515
private_class_method :finalizer
@@ -32,7 +32,7 @@ def decompress_init!(small = false)
3232
result = FFI::Libbz2::BZ2_bzDecompressInit(@stream, 0, small ? 1 : 0)
3333
check_error(result)
3434

35-
ObjectSpace.define_finalizer(self, self.class.send(:finalizer))
35+
ObjectSpace.define_finalizer(self, self.class.send(:finalizer, @stream))
3636

3737
true
3838
end

0 commit comments

Comments
 (0)