Skip to content

Commit

Permalink
Fix layout animation crashes on the New Architecture (#6920)
Browse files Browse the repository at this point in the history
## Summary

This PR adds a `contains` check for layout animation config. When we
schedule the start of an animation, we check if an animation is
configured for the given view. But it might happen that before the
`LayoutAnimationsManager::startLayoutAnimation` function gets executed,
the view gets removed. When the view is removed we clear the config, so
the `startLayoutAnimation` function will get a `nullptr` config,
resulting in a crash.

fixes #6908

## Test plan
  • Loading branch information
bartlomiejbloniarz authored Jan 27, 2025
1 parent bfc3cfb commit 60f7b02
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ void LayoutAnimationsManager::startLayoutAnimation(
std::shared_ptr<Shareable> config;
{
auto lock = std::unique_lock<std::recursive_mutex>(animationsMutex_);
if (!collection::contains(getConfigsForType(type), tag)) {
return;
}
config = getConfigsForType(type)[tag];
}
// TODO: cache the following!!
Expand Down

0 comments on commit 60f7b02

Please sign in to comment.