Skip to content

Commit

Permalink
fix crash on quit right after launch (#2896)
Browse files Browse the repository at this point in the history
  • Loading branch information
mallexxx authored Jun 24, 2024
1 parent 1b7bdc5 commit 096e700
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions DuckDuckGo/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -636,13 +636,15 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
}
}

@MainActor
private func setUpAutoClearHandler() {
DispatchQueue.main.async {
self.autoClearHandler = AutoClearHandler(preferences: .shared,
let autoClearHandler = AutoClearHandler(preferences: .shared,
fireViewModel: FireCoordinator.fireViewModel,
stateRestorationManager: self.stateRestorationManager)
self.autoClearHandler.handleAppLaunch()
self.autoClearHandler.onAutoClearCompleted = {
stateRestorationManager: self.stateRestorationManager)
self.autoClearHandler = autoClearHandler
DispatchQueue.main.async {
autoClearHandler.handleAppLaunch()
autoClearHandler.onAutoClearCompleted = {
NSApplication.shared.reply(toApplicationShouldTerminate: true)
}
}
Expand Down

0 comments on commit 096e700

Please sign in to comment.