SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Fix unsafe rawPointer access in cloneMultiple (#55613)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55613

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.

Changelog:
[General][Breaking] - fix unsafe rawPointer access in cloneMultiple.

Reviewed By: zeyap, javache

Differential Revision: D93596770

fbshipit-source-id: c4d99b51875968ebce50358c19502cba02c50685
D
Dawid Małecki committed
1d476932305f2563d773eb04f0f78a9bdd2525e1
Parent: 21e6aa3
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 3/4/2026, 12:44:41 AM