Skip to content

Commit

Permalink
Fix crash on Fabric iOS caused by concurrent runtime access (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekzaw authored Jul 5, 2024
1 parent 5d4e106 commit 490775f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ios/RCTMarkdownUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ - (NSAttributedString *)parseMarkdown:(nullable NSAttributedString *)input withA
}

static std::shared_ptr<jsi::Runtime> runtime;
static std::mutex runtimeMutex;
auto lock = std::lock_guard<std::mutex>(runtimeMutex);

if (runtime == nullptr) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"react-native-live-markdown-parser" ofType:@"js"];
assert(path != nil && "[react-native-live-markdown] Markdown parser bundle not found");
Expand Down

0 comments on commit 490775f

Please sign in to comment.