fix: very minor memory leak

This commit is contained in:
lwouis committed 2026-06-03 21:17:45 +02:00
1 parent e0b1778db7
commit 7d60d55395
2 files changed
+8

No files matched your search

+4
View File
@@ -211,6 +211,10 @@ class Applications {
let pid = tApp.processIdentifier
AXCallScheduler.shared.removeEntry(key: "pid-\(pid)")
AXCallScheduler.shared.removeEntries(withPrefix: "pid-\(pid)-")
// one-shot subscription keys (see Application.observeEvents) use the `sub-app-` prefix, which
// the `pid-` cleanup above misses; strip them here too or they leak 6 entries per app.
AXCallScheduler.shared.removeEntry(key: "sub-app-\(pid)")
AXCallScheduler.shared.removeEntries(withPrefix: "sub-app-\(pid)-")
AXCallScheduler.shared.removeUnresponsivePid(pid)
}
App.refreshOpenUiAfterExternalEvent([])
+4
View File
@@ -460,6 +460,10 @@ class Windows {
for w in windows {
if let wid = w.cgWindowId {
AXCallScheduler.shared.removeEntries(withPrefix: "wid-\(wid)-")
// one-shot subscription keys (see Window.observeEvents) use the `sub-win-` prefix, so the
// `wid-` cleanup above misses them; strip them here too or they leak 6 entries per window.
AXCallScheduler.shared.removeEntry(key: "sub-win-\(wid)")
AXCallScheduler.shared.removeEntries(withPrefix: "sub-win-\(wid)-")
Applications.windowAttributesThrottler.removeEntries(withPrefix: "\(wid)-")
Applications.screenshotThrottler.removeEntry(withKey: "capture-wid-\(wid)")
}