Skip to content

Commit

Permalink
fix: close before returning
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Aug 27, 2023
1 parent 45fae3f commit 64a96fc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ class MainActivity : FlutterActivity() {

if (cancel) {
handler.post { stopResult!!.success(null) }
patcher.close()
return@Thread
}

Expand All @@ -279,8 +280,10 @@ class MainActivity : FlutterActivity() {
)
)
}

val res = patcher.get()
patcher.close()

ZipFile(patchedFile).use { file ->
res.dexFiles.forEach {
if (cancel) {
Expand All @@ -303,10 +306,12 @@ class MainActivity : FlutterActivity() {
ZipAligner::getEntryAlignment
)
}

if (cancel) {
handler.post { stopResult!!.success(null) }
return@Thread
}

handler.post {
installerChannel.invokeMethod(
"update",
Expand Down

0 comments on commit 64a96fc

Please sign in to comment.