summaryrefslogtreecommitdiff
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r--lib/tempfile.rb1
1 files changed, 1 insertions, 0 deletions
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