Fix race condition when reporting mounting transactions for deallocated surfaces (#47008)

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

Changelog: [internal]

This code is gated anyway so there's no harm in production.

Reviewed By: javache

Differential Revision: D64322331

fbshipit-source-id: 005eb385f7e5ccd3d33e2d8c28e45b84f1537d68
This commit is contained in:
Rubén Norte
2024-10-14 04:16:04 -07:00
committed by Facebook GitHub Bot
parent 60bc3c5aed
commit b5271779ec
@@ -121,7 +121,10 @@ void FabricUIManagerBinding::reportMount(SurfaceId surfaceId) {
}
}
if (surfaceHandler != nullptr) {
surfaceHandler->getMountingCoordinator()->didPerformAsyncTransactions();
auto mountingCoordinator = surfaceHandler->getMountingCoordinator();
if (mountingCoordinator != nullptr) {
mountingCoordinator->didPerformAsyncTransactions();
}
}
} else {
LOG(ERROR) << "FabricUIManagerBinding::reportMount: Surface with id "