fix: add lock to asset handler handle request on android (#4006)

This commit is contained in:
Rhaskia authored and GitHub committed 2025-04-22 00:32:45 -07:00
1 parent 5f1df68e0d
commit 1ac57f1a36
1 file changed
+4
+4
View File
@@ -33,6 +33,10 @@ impl AssetHandlerRegistry {
responder: RequestAsyncResponder,
) {
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
handler.f.call((request, responder));
}