[前][次][番号順一覧][スレッド一覧]

ruby-changes:15766

From: tenderlove <ko1@a...>
Date: Sun, 9 May 2010 10:58:19 +0900 (JST)
Subject: [ruby-changes:15766] Ruby:r27695 (trunk): * test/dl/test_callback.rb: fixing valgrind errors. Ruby string may be

tenderlove	2010-05-09 10:57:54 +0900 (Sun, 09 May 2010)

  New Revision: 27695

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27695

  Log:
    * test/dl/test_callback.rb: fixing valgrind errors.  Ruby string may be
      GC'd before the callback returns.

  Modified files:
    trunk/test/dl/test_callback.rb

Index: test/dl/test_callback.rb
===================================================================
--- test/dl/test_callback.rb	(revision 27694)
+++ test/dl/test_callback.rb	(revision 27695)
@@ -29,8 +29,9 @@
     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])

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]