Class: Plaything::OpenAL::ManagedPointer

Inherits:
FFI::AutoPointer
  • Object
show all
Defined in:
lib/plaything/support/managed_pointer.rb

Direct Known Subclasses

Context, Device

Class Method Summary collapse

Class Method Details

.release(pointer) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/plaything/support/managed_pointer.rb', line 5

def release(pointer)
  if pointer.null?
    warn "Trying to release NULL #{name}."
  elsif block_given?
    yield pointer
  else
    warn "No releaser for #{name}."
  end
rescue => e
  warn "release for #{name} failed: #{e.message}."
end