Skip to content

Commit

Permalink
Fix leaking memory due to not improper cleanup of references to detac…
Browse files Browse the repository at this point in the history
…hed nodes (#1645)

* Add missing event listeners removal in element-overflow-controller

* Add missing clear dictionaries in element-overflow-controller

* Add missing removeAllEventListeners to display-anki _onContentClear
  • Loading branch information
Kuuuube authored Dec 10, 2024
1 parent 8f58bf9 commit e38c1f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ext/js/display/display-anki.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export class DisplayAnki {
this._updateDictionaryEntryDetailsToken = null;
this._dictionaryEntryDetails = null;
this._hideErrorNotification(false);
this._eventListeners.removeAllEventListeners();
}

/** */
Expand Down
2 changes: 2 additions & 0 deletions ext/js/display/element-overflow-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ export class ElementOverflowController {
/** */
clearElements() {
this._elements.length = 0;
this._eventListeners.removeAllEventListeners();
this._windowEventListeners.removeAllEventListeners();
this._dictionaries.clear();
}

// Private
Expand Down

0 comments on commit e38c1f0

Please sign in to comment.