Issue #6751 has been updated by xibbar (Takeyuki Fujioka).

Status changed from Assigned to Closed

??????????????????????????????
akr???????????????????????????????????????????????????????

----------------------------------------
Bug #6751: remove tempfiles early.
https://bugs.ruby-lang.org/issues/6751#change-36440

Author: akr (Akira Tanaka)
Status: Closed
Priority: Normal
Assignee: xibbar (Takeyuki Fujioka)
Category: lib
Target version: 2.1.0
ruby -v: ruby 2.0.0dev (2012-07-18 trunk 36442) [x86_64-linux]


cgi.rb ????????????????????? (Tempfile) ??????????????????????????????????????
???????????????????????????????????????

????????? GC ???????????????????????Bug ???????????話?????????????????????

./ruby test/runner.rb test/cgi ???????????????????????????????????????????????
????????????? cgi-tempfile.patch ?????????????????????

* read_multipart ??? params ???????????????????????????
* read_multipart ????????起???????????????????????????????????????
* ?????????????????????????????????????????????????

?????????????????????????????確???????????以?????????????????????????????

Index: lib/minitest/unit.rb
===================================================================
--- lib/minitest/unit.rb	(revision 36442)
+++ lib/minitest/unit.rb	(working copy)
@@ -1082,6 +1082,10 @@ module MiniTest
           end
           trap 'INFO', 'DEFAULT' if SUPPORTS_INFO_SIGNAL
         end
+        if !(live_tempfiles = ObjectSpace.each_object(Tempfile).find_all {|t| t.path }).empty?
+          puts nil, "after #{self.__name__}", *live_tempfiles.map {|t| t.inspect }
+          live_tempfiles.each {|t| t.unlink }
+        end
         result
       end

????????????????????



-- 
http://bugs.ruby-lang.org/