Fix two big DOM leaks which were locking Chrome solid.
pillifyLinks leaked Pill components, which if they contained a BaseAvatar would leak a whole DOM tree retained by the BaseAvatar's onClientSync event listener. This tracks the Pill containers so they can be unmounted via unmountPills. BasicMessageComposer set an event listener on selectionchange in onFocus which leaked if onBlur wasn't called. This removes it in unmount. We've also seen Velociraptor retaining full DOM trees from RRs, which this doesn't address as the leak is probably within Velocity, and the plan is to replace it with CSS animations. Should fix https://github.com/vector-im/riot-web/issues/12417
This commit is contained in:
parent
d088879c12
commit
7696f704b2
4 changed files with 44 additions and 7 deletions
|
@ -490,6 +490,7 @@ export default class BasicMessageEditor extends React.Component {
|
|||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
document.removeEventListener("selectionchange", this._onSelectionChange);
|
||||
this._editorRef.removeEventListener("input", this._onInput, true);
|
||||
this._editorRef.removeEventListener("compositionstart", this._onCompositionStart, true);
|
||||
this._editorRef.removeEventListener("compositionend", this._onCompositionEnd, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue