Bug 1246839 - Close FileOutputStream in BrowserApp. r=rnewman

MozReview-Commit-ID: C2tWuetVrqp
This commit is contained in:
Michael Comella 2016-02-08 17:55:48 -08:00
parent 5cc757ff9c
commit 02f19e5d08

View File

@ -3300,8 +3300,14 @@ public class BrowserApp extends GeckoApp
File outFile = new File(cacheDir, "thumbnail.png");
try {
java.io.FileOutputStream out = new java.io.FileOutputStream(outFile);
thumbnail.compress(Bitmap.CompressFormat.PNG, 90, out);
final java.io.FileOutputStream out = new java.io.FileOutputStream(outFile);
try {
thumbnail.compress(Bitmap.CompressFormat.PNG, 90, out);
} finally {
try {
out.close();
} catch (final IOException e) { /* Nothing to do here. */ }
}
} catch (FileNotFoundException e) {
Log.e(LOGTAG, "File not found", e);
}