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
This commit is contained in:
Etienne Massip 2012-07-10 20:16:07 +00:00
parent e2851a8b2a
commit 7502ac484e
1 changed files with 2 additions and 1 deletions

View File

@ -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
#