mirror of
https://github.com/lwouis/alt-tab-macos.git
synced 2026-05-24 11:20:36 +00:00
fix: avoid memory usage growth over time (closes #5138)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user