mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -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:
@@ -900,7 +900,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
const rowPos = rows.length;
|
||||
|
||||
while ((rowPos < trs.length) && (trs.length > 0))
|
||||
trs.pop().destroy();
|
||||
trs.pop().remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1022,7 +1022,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
}
|
||||
else {
|
||||
const tr = this.getTrByRowId(rowId);
|
||||
tr?.destroy();
|
||||
tr?.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1034,7 +1034,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||
}
|
||||
else {
|
||||
for (const tr of this.getTrs())
|
||||
tr.destroy();
|
||||
tr.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user