Fix crash when opening & closing Preferences after changing account

The old ProfileHeaderView was being leaked, and it was still listening
to the preferencesDidChange notification, but crashing because its
delegate (and therefore MastodonController) had been dealloc'd.
This commit is contained in:
Shadowfacts 2021-02-06 15:29:35 -05:00
parent 9d5c004ec4
commit 02ba45fa34
1 changed files with 2 additions and 2 deletions

View File

@ -223,8 +223,8 @@ extension MenuPreviewProvider {
}
private func openInSafariAction(url: URL) -> UIAction {
return createAction(identifier: "openinsafari", title: "Open in Safari", systemImageName: "safari", handler: { (_) in
self.navigationDelegate?.selected(url: url, allowUniversalLinks: false)
return createAction(identifier: "openinsafari", title: "Open in Safari", systemImageName: "safari", handler: { [weak self] (_) in
self?.navigationDelegate?.selected(url: url, allowUniversalLinks: false)
})
}