Skip to content


[FFI] FFI::AutoPointer#free causes FFI::AutoPointer#autorelease? to cast NullPointerException #654

Burgestrand opened this Issue · 0 comments

1 participant

require "ffi"

class Releasable < FFI::AutoPointer
  def self.release(pointer)
    puts "Release"
    # no op

p =
r =
p r.autorelease? # => NullPointerException

It’s because when AutoPointer#free is called, the reaper (managed for releasing the pointer) is reassigned to null. This causes AutoPointer#autorelease? to fail, since reaper is now no longer.

@ghost Unknown added a commit that closed this issue
Wayne Meissner Fix #654 - FFI::AutoPointer#free causes FFI::AutoPointer#autorelease?…
… to cast NullPointerException
@ghost ghost closed this in c253096
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.