diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-02 15:35:09 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-02 15:35:09 +0200 |
commit | d498b07533d9a14d72cdbb44f3f7a07f1c9e86ad (patch) | |
tree | c9182dfefc05f3b89a7d99627d630cfaf36022ae /lib/efl | |
parent | d3ee070b62a25c802dff62084dbf3ef53dc6eeb7 (diff) | |
download | ffi-efl-d498b07533d9a14d72cdbb44f3f7a07f1c9e86ad.zip ffi-efl-d498b07533d9a14d72cdbb44f3f7a07f1c9e86ad.tar.gz |
fix REcorePipe pointer mangement
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 |