Skip to content

Instantly share code, notes, and snippets.

@invisiblek
Created January 31, 2017 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save invisiblek/d5fdff4df7aaaea9822a1083d8f4139c to your computer and use it in GitHub Desktop.
Save invisiblek/d5fdff4df7aaaea9822a1083d8f4139c to your computer and use it in GitHub Desktop.
diff --git a/src/com/cyanogenmod/updater/service/DownloadCompleteIntentService.java b/src/com/cyanogenmod/updater/service/DownloadCompleteIntentService.java
index 1eacc4a..b8dd0c1 100644
--- a/src/com/cyanogenmod/updater/service/DownloadCompleteIntentService.java
+++ b/src/com/cyanogenmod/updater/service/DownloadCompleteIntentService.java
@@ -87,6 +87,11 @@ public class DownloadCompleteIntentService extends IntentService {
FileChannel inChannel = inStream.getChannel();
FileChannel outChannel = outStream.getChannel();
inChannel.transferTo(0, inChannel.size(), outChannel);
+
+ inChannel.close();
+ outChannel.close();
+ inStream.close();
+ outStream.close();
} catch (IOException e) {
displayErrorResult(updateIntent, R.string.unable_to_download_file);
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment