Don't (always) leak the file descriptor.

It's still very much possible to leak the descriptor (when an exception occurs
somewhere in between or anything else goes wrong). So maybe the whole thing
should be redesigned to be independent of files.
This commit is contained in:
cpfeiffer 2015-08-06 00:40:49 +02:00
parent b7223c7e86
commit 8dee55198e
1 changed files with 5 additions and 0 deletions

View File

@ -419,6 +419,11 @@ public class PebbleIoThread extends GBDeviceIoThread {
mPBWReader = null;
mIsInstalling = false;
try {
mZis.close();
} catch (IOException e) {
// ignore
}
mZis = null;
mAppInstallToken = -1;
mInstallSlot = -2;