Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix dangling surfaces in ReactHostImpl (#44393)
Summary: Though the `ReactHost.destroy()` is not being used from OSS code, we use it at Expo for expo-dev-client to change loading apps from different dev servers. Without cleanup the `mAttachedSurfaces`, it will have dangling or duplicated attached surfaces that cause duplicated react trees. <img src="https://github.com/facebook/react-native/assets/46429/f84d274e-aaad-4352-9e3c-6262571a5625"> This PR tries to cleanup the `mAttachedSurfaces` from destroying. ## Changelog: [ANDROID] [FIXED] - Fixed dangling `mAttachedSurfaces` after `ReactHost.destroy()` Pull Request resolved: #44393 Test Plan: have to manually call `ReactHost.destroy()` and recreate the MainActivity without killing the process. then reload the app will startSurface for the same attached surfaces. Reviewed By: RSNara Differential Revision: D56901863 Pulled By: javache fbshipit-source-id: c7f822501d971810ac6aa7262b15da69ec41355e
- Loading branch information