* test/dl/test_callback.rb: fixing valgrind errors. Ruby string may be

GC'd before the callback returns.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2010-05-09 01:57:54 +00:00
parent 7021db80f3
commit 1b979ea721

View File

@ -29,8 +29,9 @@ module DL
end
def test_callback_return_arbitrary
foo = 'foo'
addr = set_callback(TYPE_VOIDP, 1) do |ptr|
CPtr['foo'].to_i
CPtr[foo].to_i
end
func = CFunc.new(addr, TYPE_VOIDP, 'test')
f = Function.new(func, [TYPE_VOIDP])