This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[android] Do not reach native if the HTTPContext was invalidated
Native will get destroyed before the Java HTTPRequest and asynchronous requests might still get answered. If the request gets canceled, we now clear the reference to the native code and it will never reach it. Lock is needed because OkHTTP replies on its own thread, so we need to guard the access to the variable we use for checking if the Request was canceled. In the future we could remove the lock and use Runnable when we move Android main loop to Looper instead of libuv. Like the other implementations of HTTPRequest on Mapbox GL Native, the request is destroyed synchronously on ::cancel().
- Loading branch information
Showing
2 changed files
with
29 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters