Skip to content

Commit 9dec89c

Browse files
zeyapfacebook-github-bot
authored andcommitted
wait for ShadowTree finish commits & unregister before clearing up props registry in shared backend
Summary: ## Changelog: [Internal] [Fixed] - wait for ShadowTree finish commits & unregister before clearing up props registry in shared backend Differential Revision: D103752709
1 parent a25e0fd commit 9dec89c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • packages/react-native/ReactCommon/react/renderer/uimanager

packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,6 @@ ShadowTree::Unique UIManager::stopSurface(SurfaceId surfaceId) const {
275275
// Stop any ongoing layout animations.
276276
stopSurfaceForAnimationDelegate(surfaceId);
277277

278-
if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
279-
animationBackend_->clearRegistryOnSurfaceStop(surfaceId);
280-
}
281-
282278
// Waiting for all concurrent commits to be finished and unregistering the
283279
// `ShadowTree`.
284280
auto shadowTree = getShadowTreeRegistry().remove(surfaceId);
@@ -295,6 +291,11 @@ ShadowTree::Unique UIManager::stopSurface(SurfaceId surfaceId) const {
295291
leakChecker_->stopSurface(surfaceId);
296292
}
297293
}
294+
295+
if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
296+
animationBackend_->clearRegistryOnSurfaceStop(surfaceId);
297+
}
298+
298299
return shadowTree;
299300
}
300301

0 commit comments

Comments
 (0)