From 65261bda4d964c081fc3a510bfaa094a7647e8bc Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 20 Apr 2013 15:16:24 +0000 Subject: * lib/tempfile.rb (Tempfile.create): Close when the block exits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ lib/tempfile.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 95a5a236c9..fd94e6ed10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Apr 21 00:15:36 2013 Tanaka Akira + + * lib/tempfile.rb (Tempfile.create): Close when the block exits. + Sat Apr 20 23:38:14 2013 Tanaka Akira * lib/webrick/httpauth/htpasswd.rb: Use Tempfile.create to avoid diff --git a/lib/tempfile.rb b/lib/tempfile.rb index fd334c173a..971e1919ea 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -370,6 +370,7 @@ def Tempfile.create(basename, *rest) begin yield tmpfile ensure + tmpfile.close if !tmpfile.closed? File.unlink tmpfile end else -- cgit v1.2.3