mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix account add crash
As reported in #3606, it was the case that attempting to add an account
could result in a crash. This fixes the problem by retaining the
`NSHostingController` that holds the `AddAccountsView` view in a manner
similar to how 48138b1 retained `accountsAddLocalWindowController`.
This commit is contained in:
@@ -24,6 +24,7 @@ final class AccountsPreferencesViewController: NSViewController {
|
||||
@IBOutlet weak var deleteButton: NSButton!
|
||||
var addAccountDelegate: AccountsPreferencesAddAccountDelegate?
|
||||
var addAccountWindowController: NSWindowController?
|
||||
var addAccountsViewController: NSHostingController<AddAccountsView>?
|
||||
|
||||
private var sortedAccounts = [Account]()
|
||||
|
||||
@@ -52,6 +53,7 @@ final class AccountsPreferencesViewController: NSViewController {
|
||||
let controller = NSHostingController(rootView: AddAccountsView(delegate: self))
|
||||
controller.rootView.parent = controller
|
||||
presentAsSheet(controller)
|
||||
addAccountsViewController = controller
|
||||
}
|
||||
|
||||
@IBAction func removeAccount(_ sender: Any) {
|
||||
|
||||
Reference in New Issue
Block a user