Class: FFI::AutoPointer::CallableReleaser

Inherits:
Releaser
  • Object
show all
Defined in:
lib/ffi/autopointer.rb

Overview

CallableReleaser is a Releaser used when an FFI::AutoPointer is defined with a Proc or a Method.

Instance Attribute Summary

Attributes inherited from Releaser

#autorelease

Instance Method Summary collapse

Methods inherited from Releaser

#call, #free, #initialize

Constructor Details

This class inherits a constructor from FFI::AutoPointer::Releaser

Instance Method Details

#release(ptr) ⇒ nil

Release ptr by using Proc or Method defined at ptr initialization.

Parameters:

Returns:

  • (nil)

174
175
176
# File 'lib/ffi/autopointer.rb', line 174

def release(ptr)
  @proc.call(ptr)
end