Class: CF::Base::Releaser
- Inherits:
-
Object
- Object
- CF::Base::Releaser
- Defined in:
- lib/corefoundation/base.rb
Instance Method Summary collapse
- #call(*ignored) ⇒ Object
-
#initialize(ptr) ⇒ Releaser
constructor
A new instance of Releaser.
Constructor Details
#initialize(ptr) ⇒ Releaser
Returns a new instance of Releaser.
49 50 51 |
# File 'lib/corefoundation/base.rb', line 49 def initialize(ptr) @address = ptr.address end |
Instance Method Details
#call(*ignored) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/corefoundation/base.rb', line 53 def call *ignored if @address != 0 CF.release(FFI::Pointer.new(:pointer, @address)) @address = 0 end end |