From 5d65794ee4fadc135d1c47ccd3bcce36e594ab8d Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Wed, 3 Sep 2025 19:01:15 -0700 Subject: [PATCH] Don't crash on reload (#53590) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53590 Changelog: [General][Fixed] ReactCxxPlatform] Don't crash on reload Reviewed By: shwanton Differential Revision: D81626640 fbshipit-source-id: 31016c67a1913a8be8578848e756e0447b802484 --- .../react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp index d35484e8455..3b63b088cc2 100644 --- a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp +++ b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp @@ -533,7 +533,9 @@ std::unordered_set ReactHost::getRunningSurfaces() const noexcept { void ReactHost::runOnScheduler( std::function&& task) const { - task(*scheduler_); + if (!isReloadingReactInstance_) { + task(*scheduler_); + } } void ReactHost::runOnRuntimeScheduler(