summaryrefslogtreecommitdiffstats
path: root/lib/plugins
diff options
context:
space:
mode:
authorEtienne Massip <etienne.massip@gmail.com>2012-07-10 20:16:07 +0000
committerEtienne Massip <etienne.massip@gmail.com>2012-07-10 20:16:07 +0000
commit7502ac484eb178bd8e97141a34ca4513e16ec44f (patch)
tree73f10de2c55257d934bd9f8efdda77318b084203 /lib/plugins
parente2851a8b2a66957b76998b7d9f16e411a4a167fe (diff)
downloadredmine-7502ac484eb178bd8e97141a34ca4513e16ec44f.tar.gz
redmine-7502ac484eb178bd8e97141a34ca4513e16ec44f.zip
Make sure that file handle is freed when an error is raised to prevent access exception on subsequent deletion attempt.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9970 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/plugins')
-rwxr-xr-xlib/plugins/rfpdf/lib/tcpdf.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/plugins/rfpdf/lib/tcpdf.rb b/lib/plugins/rfpdf/lib/tcpdf.rb
index 287e81bb7..83996bd09 100755
--- a/lib/plugins/rfpdf/lib/tcpdf.rb
+++ b/lib/plugins/rfpdf/lib/tcpdf.rb
@@ -2981,8 +2981,9 @@ class TCPDF
if (colspace=='Indexed' and pal.empty?)
Error('Missing palette in ' + file);
end
- f.close
return {'w' => w, 'h' => h, 'cs' => colspace, 'bpc' => bpc, 'f'=>'FlateDecode', 'parms' => parms, 'pal' => pal, 'trns' => trns, 'data' => data}
+ ensure
+ f.close
end
#