Skip to content

Fix unsafe rawPointer access in cloneMultiple#55613

Open
bartlomiejbloniarz wants to merge 1 commit intomainfrom
export-D93596770
Open

Fix unsafe rawPointer access in cloneMultiple#55613
bartlomiejbloniarz wants to merge 1 commit intomainfrom
export-D93596770

Conversation

@bartlomiejbloniarz
Copy link
Contributor

Summary:
The cloneMultiple method was written in a way to accept a list of families that are presumed to be owned by the api caller. This designe was mostly aimed at reanimated, that holds refernces to ShadowNodes (that own these families). In the case of AnimationBackend this didn't work properly, as when the view is unmounted we would lose the ShadowNodeFamily shared_ptr that we hold and it could get deallocated.

Since now we can get an owning reference to ShadowNodeFamily from ShadowNode::getFamilyShared, we don't have to keep this old unsafe api. Instead we require the caller to have an owning reference with the api itself.

This cloneMultiple method isn't really adopted in the community, so the breaking change shouldn't be a big problem.

Differential Revision: D93596770

Summary:
The cloneMultiple method was written in a way to accept a list of families that are presumed to be owned by the api caller. This designe was mostly aimed at reanimated, that holds refernces to ShadowNodes (that own these families). In the case of AnimationBackend this didn't work properly, as when the view is unmounted we would lose the ShadowNodeFamily shared_ptr that we hold and it could get deallocated.

Since now we can get an owning reference to ShadowNodeFamily from ShadowNode::getFamilyShared, we don't have to keep this old unsafe api. Instead we require the caller to have an owning reference with the api itself.

This `cloneMultiple` method isn't really adopted in the community, so the breaking change shouldn't be a big problem.

Differential Revision: D93596770
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 18, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 18, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments