diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java index 5ab8c2a7411965..d9406fc00b7592 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java @@ -1543,9 +1543,9 @@ private Task getOrCreateDestroyTask(final String reason, @Nullable Excepti // Step 3: Stop all React Native surfaces stopAttachedSurfaces(method, reactInstance); - - // TODO(T161461674): Should we clear mAttachedSurfaces? - // Not clearing mAttachedSurfaces could lead to a memory leak. + synchronized (mAttachedSurfaces) { + mAttachedSurfaces.clear(); + } return task; },