Skip to content

Commit ac81869

Browse files
etodanikmeta-codesync[bot]
authored andcommitted
Fix crash on reload (#56594)
Summary: Revert crash on reload caused by 45b4817#diff-99e9fee4dbe9d329e2f7df16035fb871fa583c92028a48fefb1c48e405638944R314-R316 j-piasecki your change that seems redundant for the destructor case (reactInstanceData_ is a unique pointer and will be destroyed anyway) and breaks the reload case (by setting `contextContainer` to `nullptr`, which is then immediately accessed by `createReactInstance`, causing a crash) ## Changelog: [GENERAL] [FIXED] - Fixed a regression that causes crashes on reload for `ReactCxxPlatform`'s `ReactHost` Pull Request resolved: #56594 Test Plan: Reload the development server Reviewed By: cortinico Differential Revision: D106362104 Pulled By: javache fbshipit-source-id: 69c6a28b81c5fd55cc1f4bac29c177e70912fa1a
1 parent b8bb88d commit ac81869

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

  • packages/react-native/ReactCxxPlatform/react/runtime

packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,6 @@ void ReactHost::destroyReactInstance() {
314314

315315
reactInstanceData_->contextContainer->erase(RuntimeSchedulerKey);
316316
reactInstanceData_->mountingManager->setSchedulerTaskExecutor(nullptr);
317-
reactInstanceData_->mountingManager = nullptr;
318-
reactInstanceData_->contextContainer = nullptr;
319-
reactInstanceData_->turboModuleProviders.clear();
320317
reactInstance_ = nullptr;
321318
reactInstanceData_->messageQueueThread = nullptr;
322319
}

0 commit comments

Comments
 (0)