summaryrefslogtreecommitdiffstats
path: root/lib/efl/ecore_getopt.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-13 08:28:59 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-13 08:28:59 +0200
commitc6cc87f36f4c561182815c0799058eb8b386ffe3 (patch)
tree260a286d9edbe9ac9fa0ce79e84693dc2cfd094c /lib/efl/ecore_getopt.rb
parenta33f6f851bd57b0dde4a8119981e10bea9af25e5 (diff)
downloadffi-efl-c6cc87f36f4c561182815c0799058eb8b386ffe3.zip
ffi-efl-c6cc87f36f4c561182815c0799058eb8b386ffe3.tar.gz
bugfix ecore_getopt pointer arg usage
Diffstat (limited to 'lib/efl/ecore_getopt.rb')
-rw-r--r--lib/efl/ecore_getopt.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/efl/ecore_getopt.rb b/lib/efl/ecore_getopt.rb
index 75aa888..fdc7ede 100644
--- a/lib/efl/ecore_getopt.rb
+++ b/lib/efl/ecore_getopt.rb
@@ -115,7 +115,6 @@ module Efl
:pointer=> [ :pointer, nil, :ptrp ],
:choice => [ :pointer, nil, :ptrp ]
}
-# @refs = [] # to prevent FFI::MemoryPointer.from_string from beeing GC'ed
end
def p_from_string r
return FFI::Pointer::NULL if r.nil?
@@ -142,6 +141,8 @@ module Efl
p = FFI::MemoryPointer.new :pointer
p.write_pointer FFI::Pointer::NULL
r = @values[skey] = [ ptype, p ]
+ when :pointer
+ r = @values[skey] = [ ptype, val ]
else
p = FFI::MemoryPointer.new ptype
p.send 'write_'+ptype.to_s, val unless val.nil?
@@ -165,8 +166,7 @@ module Efl
p = ptr.read_pointer
(p==FFI::Pointer::NULL ? nil : p.read_string )
when :pointer
- p = ptr.read_pointer
- ( p==FFI::Pointer::NULL ? nil : p )
+ ptr
else
ptr.send 'read_'+ptype.to_s
end