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

ruby-changes:20657

From: nagachika <ko1@a...>
Date: Wed, 27 Jul 2011 22:49:56 +0900 (JST)
Subject: [ruby-changes:20657] nagachika:r32705 (trunk): * test/rinda/test_rinda.rb (test_remote_array_and_hash):

nagachika	2011-07-27 22:49:43 +0900 (Wed, 27 Jul 2011)

  New Revision: 32705

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

  Log:
    * test/rinda/test_rinda.rb (test_remote_array_and_hash):
      add local variables to protect objects from GC. [ruby-dev:44253]
      [Bug #5104]

  Modified files:
    trunk/ChangeLog
    trunk/test/rinda/test_rinda.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32704)
+++ ChangeLog	(revision 32705)
@@ -1,3 +1,9 @@
+Wed Jul 27 22:46:59 2011  CHIKANAGA Tomoyuki  <nagachika00@g...>
+
+	* test/rinda/test_rinda.rb (test_remote_array_and_hash):
+	  add local variables to protect objects from GC. [ruby-dev:44253]
+	  [Bug #5104]
+
 Wed Jul 27 17:55:54 2011  NARUSE, Yui  <naruse@r...>
 
 	* include/ruby/missing.h: define __syscall if the platform has
Index: test/rinda/test_rinda.rb
===================================================================
--- test/rinda/test_rinda.rb	(revision 32704)
+++ test/rinda/test_rinda.rb	(revision 32705)
@@ -539,9 +539,13 @@
   end
 
   def test_remote_array_and_hash
-    @ts.write(DRbObject.new([1, 2, 3]))
+    # Don't remove ary/hsh local variables.
+    # These are necessary to protect objects from GC.
+    ary = [1, 2, 3]
+    @ts.write(DRbObject.new(ary))
     assert_equal([1, 2, 3], @ts.take([1, 2, 3], 0))
-    @ts.write(DRbObject.new({'head' => 1, 'tail' => 2}))
+    hsh = {'head' => 1, 'tail' => 2}
+    @ts.write(DRbObject.new(hsh))
     assert_equal({'head' => 1, 'tail' => 2},
                  @ts.take({'head' => 1, 'tail' => 2}, 0))
   end

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

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