mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
ensure closing of filewriter in manasymbols
This commit is contained in:
parent
b2e2f48ad9
commit
a0a2ac1b5a
1 changed files with 9 additions and 4 deletions
|
@ -41,6 +41,7 @@ import mage.client.constants.Constants.ResourceSymbolSize;
|
|||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.gui.BufferedImageBuilder;
|
||||
import mage.utils.StreamUtils;
|
||||
import org.apache.batik.dom.svg.SVGDOMImplementation;
|
||||
import org.apache.batik.transcoder.TranscoderException;
|
||||
import org.apache.batik.transcoder.TranscoderInput;
|
||||
|
@ -249,10 +250,15 @@ public final class ManaSymbols {
|
|||
+ "color-rendering: optimizeQuality;"
|
||||
+ "image-rendering: optimizeQuality;"
|
||||
+ "}";
|
||||
|
||||
File cssFile = File.createTempFile("batik-default-override-", ".css");
|
||||
FileWriter w = new FileWriter(cssFile);
|
||||
w.write(css);
|
||||
w.close();
|
||||
FileWriter w = null;
|
||||
try {
|
||||
w = new FileWriter(cssFile);
|
||||
w.write(css);
|
||||
} finally {
|
||||
StreamUtils.closeQuietly(w);
|
||||
}
|
||||
|
||||
TranscodingHints transcoderHints = new TranscodingHints();
|
||||
|
||||
|
@ -284,7 +290,6 @@ public final class ManaSymbols {
|
|||
|
||||
try {
|
||||
TranscoderInput input = new TranscoderInput(new FileInputStream(svgFile));
|
||||
|
||||
ImageTranscoder t = new ImageTranscoder() {
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue