diff options
Diffstat (limited to 'lib/efl')
-rw-r--r-- | lib/efl/ecore.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/efl/ecore.rb b/lib/efl/ecore.rb index b4d8aaa..4938651 100644 --- a/lib/efl/ecore.rb +++ b/lib/efl/ecore.rb @@ -17,9 +17,16 @@ module Efl # class REcorePipe def initialize cb, data - @ptr = Efl::Ecore.ecore_pipe_add cb, data + @ptr = FFI::AutoPointer.new Efl::Ecore.ecore_pipe_add(cb, data), REcorePipe.method(:release) + end + def self.release p + Efl::Ecore.ecore_pipe_del p + end + def del + @ptr.autorelease=false + REcorePipe.release @ptr + @ptr=nil end - def del; Efl::Ecore.ecore_pipe_del @ptr; end def read_close; Efl::Ecore.ecore_pipe_read_close @ptr; end def write_close; Efl::Ecore.ecore_pipe_write_close @ptr; end def write data |