mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-16 21:02:04 +00:00
Prevent multiple sheet presentations
https://stackoverflow.com/questions/31754888/presentedviewcontrollers-memory-leak XXX: weird though.
This commit is contained in:
parent
ecc4c6f87e
commit
7a61de9ae1
@ -487,6 +487,9 @@ class StatusMenu: NSObject {
|
||||
|
||||
@objc private func editAccountCredentials(_ sender: Any?) {
|
||||
let organizer = WindowManager.shared.showOrganizer()
|
||||
guard organizer?.contentViewController?.presentedViewControllers?.isEmpty ?? true else {
|
||||
return
|
||||
}
|
||||
let accountController = StoryboardScene.Service.accountViewController.instantiate()
|
||||
accountController.profile = service.activeProfile
|
||||
organizer?.contentViewController?.presentAsSheet(accountController)
|
||||
@ -494,6 +497,9 @@ class StatusMenu: NSObject {
|
||||
|
||||
@objc private func customizeProfile(_ sender: Any?) {
|
||||
let organizer = WindowManager.shared.showOrganizer()
|
||||
guard organizer?.contentViewController?.presentedViewControllers?.isEmpty ?? true else {
|
||||
return
|
||||
}
|
||||
let profileCustomization = StoryboardScene.Service.profileCustomizationContainerViewController.instantiate()
|
||||
profileCustomization.profile = service.activeProfile
|
||||
organizer?.contentViewController?.presentAsSheet(profileCustomization)
|
||||
|
@ -92,12 +92,12 @@ class AccountViewController: NSViewController {
|
||||
}
|
||||
|
||||
delegate?.accountController(self, didUpdateCredentials: credentials, forProfile: profile)
|
||||
dismiss(self)
|
||||
presentingViewController?.dismiss(self)
|
||||
}
|
||||
|
||||
@IBAction private func delegateAndDismiss(_ sender: Any?) {
|
||||
delegate?.accountControllerDidCancel(self)
|
||||
dismiss(self)
|
||||
presentingViewController?.dismiss(self)
|
||||
}
|
||||
|
||||
override func cancelOperation(_ sender: Any?) {
|
||||
|
@ -169,7 +169,7 @@ class ProfileCustomizationContainerViewController: NSViewController {
|
||||
}
|
||||
}
|
||||
|
||||
dismiss(self)
|
||||
presentingViewController?.dismiss(self)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,6 @@ class TrustedNetworksAddViewController: NSViewController {
|
||||
return
|
||||
}
|
||||
delegate?.trustedController(self, didEnterSSID: ssid)
|
||||
dismiss(self)
|
||||
presentingViewController?.dismiss(self)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user