Skip to content

fix: destroy _resizeObject to avoid potential memory leak#62

Merged
Akryum merged 1 commit into
Akryum:masterfrom
rocka:fix/destroy-resize-object
Apr 12, 2020
Merged

fix: destroy _resizeObject to avoid potential memory leak#62
Akryum merged 1 commit into
Akryum:masterfrom
rocka:fix/destroy-resize-object

Conversation

@rocka
Copy link
Copy Markdown
Contributor

@rocka rocka commented Apr 12, 2020

I'm facing some severe memory leak issues recently. After some digging, I found that RecycleScroller haven't been destroyed under certain circumastances.

delete this._resizeObject.onload

the code above can't actually remove the event listener, instead, we should assign the value to null :

And the reference to _resizeObject should also be removed, to allow GC of the entrie DOM tree, see: https://developers.google.com/web/tools/chrome-devtools/memory-problems/heap-snapshots#uncover_dom_leaks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants