[DevTools] Clean up Virtual Instances from id map (#34063)
This was a pretty glaring memory leak. 🙈 I forgot to clean up the VirtualInstances from the id map so the Server Component instances always leaked in DEV.
Sebastian Markbåge committed
Jul 31, 2025 at 10:30 UTC
c260b38d0a082641342fc45ff5ac96e32f764f20
1 file changed
+2
packages/react-devtools-shared/src/backend/fiber/renderer.js
+2
@@ -2749,6 +2749,8 @@ export function attach(
2749
2750
const id = instance.id;
2751
pendingRealUnmountedIDs.push(id);
2752
+
2753
+ idToDevToolsInstanceMap.delete(instance.id);
2754
}
2755
2756
function getSecondaryEnvironmentName(