Skip to content

Unregister AnimationBackendCommitHook in ~AnimationBackend (#60523) - #60523

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
Abbondanzo:export-D136090145
Dec 4, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
Abbondanzo:export-D136090145

Conversation

@Abbondanzo

@Abbondanzo Abbondanzo commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

AnimationBackend registers commitHook_ with UIManager in its constructor, but ~AnimationBackend() previously did not unregister it. If AnimationBackend is destroyed while UIManager is still alive, UIManager::commitHooks_ retains a dangling pointer that crashes on the next ShadowTree commit.

Unregister commitHook_ from UIManager in ~AnimationBackend() when uiManager_ is still alive.

Changelog:
[General][Fixed] - Unregister AnimationBackendCommitHook when AnimationBackend is destroyed

Signed-off-by: Peter Abbondanzo abbo@meta.com

Reviewed By: javache

Differential Revision: D136090145

@meta-codesync

meta-codesync Bot commented Dec 3, 2026

Copy link
Copy Markdown

@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D136090145.

@javache javache left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

Summary:

`AnimationBackend` registers `commitHook_` with `UIManager` in its constructor, but `~AnimationBackend()` previously did not unregister it. If `AnimationBackend` is destroyed while `UIManager` is still alive, `UIManager::commitHooks_` retains a dangling pointer that crashes on the next `ShadowTree` commit.

Unregister `commitHook_` from `UIManager` in `~AnimationBackend()` when `uiManager_` is still alive.

Changelog:
[General][Fixed] - Unregister `AnimationBackendCommitHook` when `AnimationBackend` is destroyed

Signed-off-by: Peter Abbondanzo <abbo@meta.com>

Reviewed By: javache

Differential Revision: D136090145
@meta-codesync meta-codesync Bot changed the title Unregister AnimationBackendCommitHook in ~AnimationBackend Unregister AnimationBackendCommitHook in ~AnimationBackend (#60523) Dec 4, 2026
@meta-codesync
meta-codesync Bot merged commit 06a4eb3 into react:main Dec 4, 2026
102 of 105 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @Abbondanzo in 06a4eb3

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged This PR has been merged. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants