Skip to content

Commit

Permalink
Fix the Libbz2::finalizer method.
Browse files Browse the repository at this point in the history
As a class method this was originally calling out to an instance method.
  • Loading branch information
hainesr committed Feb 2, 2025
1 parent 88f6893 commit 65cd2b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/zip/bzip2/libbz2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
module Zip
module Bzip2
class Libbz2 #:nodoc:
def self.finalizer
def self.finalizer(stream)
lambda do |_id|
decompress_end
FFI::Libbz2::BZ2_bzDecompressEnd(stream)
end
end
private_class_method :finalizer
Expand All @@ -32,7 +32,7 @@ def decompress_init!(small = false)
result = FFI::Libbz2::BZ2_bzDecompressInit(@stream, 0, small ? 1 : 0)
check_error(result)

ObjectSpace.define_finalizer(self, self.class.send(:finalizer))
ObjectSpace.define_finalizer(self, self.class.send(:finalizer, @stream))

true
end
Expand Down

0 comments on commit 65cd2b4

Please sign in to comment.