Skip to content

Commit 134506a

Browse files
committed
Destroy workspaces when possible
1 parent c41f4ca commit 134506a

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Core/Sources/Service/ScheduledCleaner.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public final class ScheduledCleaner {
6161
}.result
6262
await workspace.cleanUp(availableTabs: [])
6363
await service.workspacePool.removeWorkspace(url: url)
64+
await service.overlayWindowController.removeController(for: url)
6465
} else {
6566
let tabs = (workspaceInfos[.url(url)]?.tabs ?? [])
6667
.union(workspaceInfos[.unknown]?.tabs ?? [])

OverlayWindow/Sources/OverlayWindow/OverlayWindowController.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ public final class OverlayWindowController {
4040
observeEvents()
4141
_ = fullscreenDetector
4242
}
43+
44+
public func removeController(for url: URL) {
45+
if let controller = ideWindowOverlayWindowControllers[url] {
46+
controller.destroy()
47+
ideWindowOverlayWindowControllers.removeValue(forKey: url)
48+
}
49+
}
50+
51+
public func removeAllControllers() {
52+
ideWindowOverlayWindowControllers.removeAll()
53+
}
4354

4455
public nonisolated static func registerIDEWorkspaceWindowOverlayWindowControllerContentProviderFactory(
4556
_ factory: @escaping IDEWorkspaceWindowOverlayWindowControllerContentProviderFactory

0 commit comments

Comments
 (0)