Fix crash when ComposeUIConfig.dismiss called after hosting controller dealloc'd
I'm not sure how this can happen (possibly if the user dismissed the compose screen while the status was being posted? but I haven't been able to reproduce that), but guard against it since it's causing crashes
This commit is contained in:
parent
173eda1757
commit
df9ce81060
|
@ -88,7 +88,7 @@ class ComposeHostingController: UIHostingController<ComposeHostingController.Vie
|
|||
config.contentType = Preferences.shared.statusContentType
|
||||
config.requireAttachmentDescriptions = Preferences.shared.requireAttachmentDescriptions
|
||||
|
||||
config.dismiss = { [unowned self] in self.dismiss(mode: $0) }
|
||||
config.dismiss = { [weak self] in self?.dismiss(mode: $0) }
|
||||
config.presentAssetPicker = { [unowned self] in self.presentAssetPicker(completion: $0) }
|
||||
config.presentDrawing = { [unowned self] in self.presentDrawing($0, completion: $1) }
|
||||
config.userActivityForDraft = { [unowned self] in
|
||||
|
|
Loading…
Reference in New Issue