class FFI::AutoPointer::Releaser
A releaser is an object in charge of release an {AutoPointer}.
All subclasses of Releaser should define a +#release(ptr)+ method.
@abstract Base class for {AutoPointer}‘s releasers.
def autorelease=(autorelease)
-
(Boolean)
- autorelease
Parameters:
-
autorelease
(Boolean
) --
def autorelease=(autorelease) @autorelease = autorelease if @ptr end
def call(*args)
-
args
() --
def call(*args) release(@ptr) if @autorelease && @ptr end
def free
-
(nil)
-
def free if @ptr release(@ptr) @autorelease = false @ptr = nil @proc = nil end end
def initialize(ptr, proc)
-
(nil)
-
Parameters:
-
proc
(#call
) -- -
ptr
(Pointer
) --
def initialize(ptr, proc) @ptr = ptr @proc = proc @autorelease = true end