fix: avoid memory usage growth over time (closes #5138)

This commit is contained in:
lwouis
2026-03-14 18:44:57 +01:00
parent 2adf741355
commit 739649a749
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -521,6 +521,11 @@ class Windows {
}
static func removeWindows(_ windows: [Window], _ addWindowlessWindowIfNeeded: Bool) {
for w in windows {
if w.application.focusedWindow?.cgWindowId == w.cgWindowId {
w.application.focusedWindow = nil
}
}
let toRemove = windows.map { $0.lastFocusOrder }
list.removeAll { w in
if toRemove.contains(w.lastFocusOrder) {
+2 -1
View File
@@ -436,9 +436,10 @@ class TilesView {
rowSignature.append(index)
window.rowIndex = rows.count - 1
} else {
// release images from unused recycledViews; they take lots of RAM
// release images and stale window references from unused recycledViews; they take lots of RAM
view.thumbnail.releaseImage()
view.appIcon.releaseImage()
view.window_ = nil
}
}
scrollView.documentView!.subviews = newViews