Skip to content

Commit b6b4799

Browse files
MosheZemahtimdorr
authored andcommitted
Free resources (free detached nodes from memory) (#1380)
* Free resources (free detached nodes from memory) Found an issue when using virtualized list (https://github.com/bvaughn/react-virtualized), where unmounted react components (connected to store using connect) were not collected by the garbage collector. I'm not sure what is the exact explanation here, but it solved my problem. * Fix lint issue * Fix lint issue * Update src/components/connectAdvanced.js Remove comment Co-Authored-By: Tim Dorr <[email protected]>
1 parent 4b9cece commit b6b4799

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/components/connectAdvanced.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ export default function connectAdvanced(
368368
const unsubscribeWrapper = () => {
369369
didUnsubscribe = true
370370
subscription.tryUnsubscribe()
371+
subscription.onStateChange = null
371372

372373
if (lastThrownError) {
373374
// It's possible that we caught an error due to a bad mapState function, but the

0 commit comments

Comments
 (0)