summaryrefslogtreecommitdiffstats
path: root/lib/efl/eina_list.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-01 08:49:59 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-01 08:49:59 +0200
commitbb7b6c52a50e65fb361ede8f26039b5822b9a0cb (patch)
tree632d6d68b93eb85350af21e05ed5575f7c377f9c /lib/efl/eina_list.rb
parent51a6645abd257b37f3248ccf26b1007a7ac88208 (diff)
downloadffi-efl-bb7b6c52a50e65fb361ede8f26039b5822b9a0cb.zip
ffi-efl-bb7b6c52a50e65fb361ede8f26039b5822b9a0cb.tar.gz
fix AutoPointer usage, not sure about REinaHash, ...
Diffstat (limited to 'lib/efl/eina_list.rb')
-rw-r--r--lib/efl/eina_list.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/efl/eina_list.rb b/lib/efl/eina_list.rb
index 42395b2..3d3ce83 100644
--- a/lib/efl/eina_list.rb
+++ b/lib/efl/eina_list.rb
@@ -37,7 +37,7 @@ module Efl
when NilClass
FFI::Pointer::NULL
when self.class
- o.ptr
+ o.to_ptr
when Array
o.inject(FFI::Pointer::NULL) { |p,e| Efl::EinaList.eina_list_append p, e }
else
@@ -45,9 +45,10 @@ module Efl
end
)
end
- def free
- return if @ptr==FFI::Pointer::NULL
- @ptr = Efl::EinaList.eina_list_free @ptr
+ def free p=nil
+ return Efl::EinaList.eina_list_free p unless p.nil?
+ Efl::EinaList.eina_list_free @ptr
+ @ptr = nil
end
def each
p = @ptr