From dccae373a8408571d180cf9f208ca610885068b3 Mon Sep 17 00:00:00 2001 From: iwater Date: Sat, 27 May 2023 01:42:02 +0800 Subject: [PATCH] fix crash on install jsi module, unsafely accessing the JS thread from the main thread --- ios/QuickMd5.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ios/QuickMd5.mm b/ios/QuickMd5.mm index 6c74e57..4521360 100644 --- a/ios/QuickMd5.mm +++ b/ios/QuickMd5.mm @@ -23,7 +23,9 @@ - (void)setBridge:(RCTBridge *)bridge return; } - installMd5(*(facebook::jsi::Runtime *)cxxBridge.runtime); + [bridge dispatchBlock:^{ + installMd5(*(facebook::jsi::Runtime *)cxxBridge.runtime); + } queue:RCTJSThread]; } - (void)invalidate {