Skip to content

Commit bf4e229

Browse files
javachefacebook-github-bot
authored andcommitted
Clear mLastQueriedSurfaceMountingManager on stopSurface (facebook#41590)
Summary: Pull Request resolved: facebook#41590 Causing a small leak while we wait for the surface to be fully destroyed. Changelog: [Internal] Reviewed By: fabriziocucci Differential Revision: D51499256 fbshipit-source-id: 8f9e65898dcb9e0261502028874378ec9cc0f3fc
1 parent c497fc6 commit bf4e229

File tree

1 file changed

+4
-1
lines changed
  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting

1 file changed

+4
-1
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,12 @@ public void stopSurface(final int surfaceId) {
143143

144144
surfaceMountingManager.stopSurface();
145145

146-
if (surfaceMountingManager == mMostRecentSurfaceMountingManager) {
146+
if (mMostRecentSurfaceMountingManager == surfaceMountingManager) {
147147
mMostRecentSurfaceMountingManager = null;
148148
}
149+
if (mLastQueriedSurfaceMountingManager == surfaceMountingManager) {
150+
mLastQueriedSurfaceMountingManager = null;
151+
}
149152
} else {
150153
ReactSoftExceptionLogger.logSoftException(
151154
TAG,

0 commit comments

Comments
 (0)