Skip to content

Commit

Permalink
[rubygems/rubygems] Fix Fiddle::Handle leaks
Browse files Browse the repository at this point in the history
Windows disallows to unlink opened files.

rubygems/rubygems@e0b63754bf
  • Loading branch information
nobu authored and hsbt committed Feb 26, 2024
1 parent 7dd4b30 commit 7176c18
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/rubygems/test_gem_ext_cargo_builder.rb
Expand Up @@ -152,12 +152,16 @@ def assert_ffi_handle(bundle, name)
require "fiddle"
dylib_handle = Fiddle.dlopen bundle
assert_nothing_raised { dylib_handle[name] }
ensure
dylib_handle&.close
end

def refute_ffi_handle(bundle, name)
require "fiddle"
dylib_handle = Fiddle.dlopen bundle
assert_raise { dylib_handle[name] }
ensure
dylib_handle&.close
end

def replace_in_rust_file(name, from, to)
Expand Down

0 comments on commit 7176c18

Please sign in to comment.