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 --- lib/tempfile.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/tempfile.rb') 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