mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
WebUI: Fix memory leak
See #22734, there is a memory leak in the MooTools .destroy(), this replaces all uses of that with the browser native .remove(). This also overrides the MooTools Document.id function, which is used by $(id). The original function always allocates an ID to elements it selects, the override doesn't, and is also a little more efficient. Closes #22734. PR #22754. --------- Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
This commit is contained in:
@@ -499,7 +499,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||
if (!categoryList)
|
||||
return;
|
||||
|
||||
[...categoryList.children].forEach((el) => { el.destroy(); });
|
||||
[...categoryList.children].forEach((el) => { el.remove(); });
|
||||
|
||||
const categoryItemTemplate = document.getElementById("categoryFilterItem");
|
||||
|
||||
@@ -620,7 +620,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||
if (tagFilterList === null)
|
||||
return;
|
||||
|
||||
[...tagFilterList.children].forEach((el) => { el.destroy(); });
|
||||
[...tagFilterList.children].forEach((el) => { el.remove(); });
|
||||
|
||||
const tagItemTemplate = document.getElementById("tagFilterItem");
|
||||
|
||||
@@ -673,7 +673,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||
if (trackerFilterList === null)
|
||||
return;
|
||||
|
||||
[...trackerFilterList.children].forEach((el) => { el.destroy(); });
|
||||
[...trackerFilterList.children].forEach((el) => { el.remove(); });
|
||||
|
||||
const trackerItemTemplate = document.getElementById("trackerFilterItem");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user