joakime / android-apk-parser

Obtain basic information out of an Android APK file.
105 stars 23 forks source link

Not closing 'zip' in the AndroidApk class #2

Closed manikantag closed 11 years ago

manikantag commented 11 years ago

In AndroidApk constructor, 'zip' instance is not being closed.

public AndroidApk(File apkfile) throws ZipException, IOException {
    ZipFile zip = new ZipFile(apkfile);
    ...
    try {
        ...
    } finally {
        IO.close(in);

        // close the zip (added by Manikanta)
        try {
            if(zip != null) {
                zip.close();
            }
        } catch(IOException e) {
            // log?
        }
    }
}
joakime commented 11 years ago

Done. committed, pushed, and new release 1.0.1 on its way to central. Thanks again :)

manikantag commented 11 years ago

Thanks