mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 709330 - AboutHomeContent.getRecommendedAddonsStream() resource leak because ZipFile was not closed r=mfinkle
This commit is contained in:
parent
78a7cf00ef
commit
332577942f
@ -236,13 +236,19 @@ public class AboutHomeContent extends ScrollView {
|
||||
if (is != null)
|
||||
return is;
|
||||
File applicationPackage = new File(activity.getApplication().getPackageResourcePath());
|
||||
ZipFile zip = new ZipFile(applicationPackage);
|
||||
if (zip == null)
|
||||
return null;
|
||||
ZipEntry fileEntry = zip.getEntry("recommended-addons.json");
|
||||
if (fileEntry == null)
|
||||
return null;
|
||||
return zip.getInputStream(fileEntry);
|
||||
ZipFile zip = null;
|
||||
try {
|
||||
zip = new ZipFile(applicationPackage);
|
||||
if (zip == null)
|
||||
return null;
|
||||
ZipEntry fileEntry = zip.getEntry("recommended-addons.json");
|
||||
if (fileEntry == null)
|
||||
return null;
|
||||
return zip.getInputStream(fileEntry);
|
||||
} finally {
|
||||
if (zip != null)
|
||||
zip.close();
|
||||
}
|
||||
}
|
||||
|
||||
void readRecommendedAddons(final Activity activity) {
|
||||
|
Loading…
Reference in New Issue
Block a user