* 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:
parent
7021db80f3
commit
1b979ea721
@ -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])
|
||||
|
Loading…
x
Reference in New Issue
Block a user