diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/tempfile.rb | 1 |
2 files changed, 5 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Sun Apr 21 00:15:36 2013 Tanaka Akira <akr@fsij.org> + + * lib/tempfile.rb (Tempfile.create): Close when the block exits. + Sat Apr 20 23:38:14 2013 Tanaka Akira <akr@fsij.org> * 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 |