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:
parent
e2851a8b2a
commit
7502ac484e
|
@ -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
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue