fix: add lock to asset handler handle request on android (#4006)
This commit is contained in:
1 parent
5f1df68e0d
commit
1ac57f1a36
1 file changed
+4
@@ -33,6 +33,10 @@ impl AssetHandlerRegistry {
|
|||||||
responder: RequestAsyncResponder,
|
responder: RequestAsyncResponder,
|
||||||
) {
|
) {
|
||||||
if let Some(handler) = self.handlers.borrow().get(name) {
|
if let Some(handler) = self.handlers.borrow().get(name) {
|
||||||
|
// Avoid handler being already borrowed on android
|
||||||
|
#[cfg(target_os = "android")]
|
||||||
|
let _lock = crate::android_sync_lock::android_runtime_lock();
|
||||||
|
|
||||||
// And run the handler in the scope of the component that created it
|
// And run the handler in the scope of the component that created it
|
||||||
handler.f.call((request, responder));
|
handler.f.call((request, responder));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user