Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Sources/AppDelegate+RecoverableMainWindowRoutes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,18 @@ extension AppDelegate {
private func recoverableMainWindowRouteSnapshot(
for route: RecoverableMainWindowRoute
) -> MainWindowRouteSnapshot? {
let cachedWindow = route.window ?? windowForMainWindowId(route.windowId)
// Check the manager before resolving the window. Resolving the window
// retires a route whose manager cannot own it, and retirement looks up
// workspace owners through this snapshot again.
guard let manager = route.tabManager,
tabManagerCanOwnRecoverableMainWindowRoute(manager),
let window = liveRecoverableMainWindow(
windowId: route.windowId,
cachedWindow: cachedWindow
) else {
tabManagerCanOwnRecoverableMainWindowRoute(manager) else {
return nil
}
let cachedWindow = route.window ?? windowForMainWindowId(route.windowId)
guard let window = liveRecoverableMainWindow(
windowId: route.windowId,
cachedWindow: cachedWindow
) else {
return nil
}
route.window = window
Expand Down
Loading