Skip to content

Commit 60c1507

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Fix crash in state reconciliation
Summary: Changelog: [internal] Repro steps: 1. Go to fbsource/fbobjc. 2. Run following focus command P124860753. 3. Enable Address Sanitizer in Xcode. 3. Run the app from Xcode. 5. Make sure `react_fabric.enable_marketplace_home_ios` and `react_fabric.enabled_state_reconciliation_ios` Mobile Config flags are set to true. 6. Navigate to Marketplace Home and observe use of freed memory exception. You have to wait until second page of marketplace home feed is loaded. {F228880980} # Root cause `ChangedShadowNodePairs` being a vector of pairs of references. Those `shared_ptr` do not outlive the the run of `reconcileStateWithTree` (that's what I originally thought when I made them references). This was introduced in D19814500. Reviewed By: JoshuaGross Differential Revision: D19977784 fbshipit-source-id: 8c4a381137baa08a6af9d3c1cb295fe6c2b2bf95
1 parent d4d8887 commit 60c1507

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ReactCommon/fabric/mounting/TreeStateReconciliation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
namespace facebook {
1111
namespace react {
1212

13-
using ChangedShadowNodePairs = std::vector<
14-
std::pair<ShadowNode::Shared const &, ShadowNode::Unshared const &>>;
13+
using ChangedShadowNodePairs =
14+
std::vector<std::pair<ShadowNode::Shared, ShadowNode::Unshared>>;
1515

1616
/**
1717
* Clones any children in the subtree that need to be cloned, and adds those to

0 commit comments

Comments
 (0)