mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-10 09:24:59 -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:
@@ -104,7 +104,7 @@
|
||||
};
|
||||
|
||||
const deleteCookie = (element) => {
|
||||
element.closest("tr").destroy();
|
||||
element.closest("tr").remove();
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
|
||||
@@ -2132,7 +2132,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
|
||||
|
||||
// Advanced Tab
|
||||
const updateNetworkInterfaces = (default_iface, default_iface_name) => {
|
||||
[...document.getElementById("networkInterface").children].forEach((el) => { el.destroy(); });
|
||||
[...document.getElementById("networkInterface").children].forEach((el) => { el.remove(); });
|
||||
|
||||
fetch("api/v2/app/networkInterfaceList", {
|
||||
method: "GET",
|
||||
@@ -2161,7 +2161,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
|
||||
};
|
||||
|
||||
const updateInterfaceAddresses = (iface, default_addr) => {
|
||||
[...document.getElementById("optionalIPAddressToBind").children].forEach((el) => { el.destroy(); });
|
||||
[...document.getElementById("optionalIPAddressToBind").children].forEach((el) => { el.remove(); });
|
||||
|
||||
const url = new URL("api/v2/app/networkInterfaceAddressList", window.location);
|
||||
url.search = new URLSearchParams({
|
||||
|
||||
@@ -425,7 +425,7 @@
|
||||
};
|
||||
|
||||
const clearDetails = () => {
|
||||
[...document.getElementById("rssDetailsView").children].forEach((el) => { el.destroy(); });
|
||||
[...document.getElementById("rssDetailsView").children].forEach((el) => { el.remove(); });
|
||||
};
|
||||
|
||||
const showDetails = (feedUid, articleID) => {
|
||||
|
||||
Reference in New Issue
Block a user