fix: complete does not destroy engine on close (#21943)

* fix: complete does not destroy engine on close

* reset flutterApi on cleanup

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2025-09-15 00:47:12 +05:30 committed by GitHub
parent 0166e99d90
commit d38468439b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -133,7 +133,6 @@ class BackgroundWorker: BackgroundWorkerBgHostApi {
return
}
isComplete = true
flutterApi?.cancel { result in
self.complete(success: false)
}
@ -174,6 +173,7 @@ class BackgroundWorker: BackgroundWorkerBgHostApi {
isComplete = true
engine.destroyContext()
flutterApi = nil
completionHandler(success)
}
}