Module: GirFFI::AllocationHelper

Defined in:
lib/gir_ffi/allocation_helper.rb

Overview

Helper module for alloction-related functionality.

Class Method Summary collapse

Class Method Details

.free_after(ptr) ⇒ Object



7
8
9
10
11
# File 'lib/gir_ffi/allocation_helper.rb', line 7

def self.free_after(ptr)
  result = yield ptr
  LibC.free ptr unless ptr.null?
  result
end