Skip to content

Commit 964f8aa

Browse files
author
Robert Gummesson
committed
Avoid terminating when closing the About window
1 parent 32e7e7d commit 964f8aa

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

BuildTimeAnalyzer/ViewController.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ class ViewController: NSViewController {
4949
projectSelection.delegate = self
5050
projectSelection.listFolders()
5151

52-
NotificationCenter.default.addObserver(self, selector: #selector(windowWillClose), name: .NSWindowWillClose, object: nil)
52+
NotificationCenter.default.addObserver(self, selector: #selector(windowWillClose(notification:)), name: .NSWindowWillClose, object: nil)
5353
}
5454

55-
func windowWillClose() {
55+
func windowWillClose(notification: NSNotification) {
56+
guard let object = notification.object, !(object is NSPanel) else { return }
5657
NotificationCenter.default.removeObserver(self)
5758

5859
processor.shouldCancel = true

0 commit comments

Comments
 (0)