Skip to content

Commit 16e554d

Browse files
zeyapfacebook-github-bot
authored andcommitted
clear up props registry in shared backend on js thread (#56677)
Summary: ## Changelog: [Internal] [Fixed] - clear up props registry in shared backend on js thread Reviewed By: christophpurrer Differential Revision: D103752709
1 parent a25e0fd commit 16e554d

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

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

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,16 @@ 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-
}
278+
runtimeExecutor_(
279+
[=,
280+
animationBackendWeak = std::weak_ptr<UIManagerAnimationBackend>(
281+
animationBackend_)](jsi::Runtime& runtime) {
282+
if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
283+
if (auto animationBackend = animationBackendWeak.lock()) {
284+
animationBackend->clearRegistryOnSurfaceStop(surfaceId);
285+
}
286+
}
287+
});
281288

282289
// Waiting for all concurrent commits to be finished and unregistering the
283290
// `ShadowTree`.
@@ -295,6 +302,7 @@ ShadowTree::Unique UIManager::stopSurface(SurfaceId surfaceId) const {
295302
leakChecker_->stopSurface(surfaceId);
296303
}
297304
}
305+
298306
return shadowTree;
299307
}
300308

0 commit comments

Comments
 (0)