瀏覽代碼

fixed more instances

nayooti 5 年之前
父節點
當前提交
8512daeb08

+ 2 - 1
deltachat-ios/Controller/ChatViewController.swift

@@ -159,7 +159,8 @@ class ChatViewController: MessagesViewController {
             forName: dcNotificationChanged,
             object: nil,
             queue: OperationQueue.main
-        ) { notification in
+        ) { [weak self] notification in
+            guard let self = self else { return }
             if let ui = notification.userInfo {
                 if self.disableWriting {
                     // always refresh, as we can't check currently

+ 2 - 1
deltachat-ios/Controller/GroupMembersViewController.swift

@@ -109,7 +109,8 @@ class AddGroupMembersViewController: GroupMembersViewController {
             forName: dcNotificationContactChanged,
             object: nil,
             queue: nil
-        ) { notification in
+        ) { [weak self] notification in
+            guard let self = self else { return }
             if let ui = notification.userInfo {
                 if let contactId = ui["contact_id"] as? Int {
                     if contactId == 0 {

+ 2 - 1
deltachat-ios/Controller/QrPageController.swift

@@ -239,7 +239,8 @@ extension QrPageController: QrCodeReaderDelegate {
             forName: dcNotificationSecureJoinerProgress,
             object: nil,
             queue: nil
-        ) { notification in
+        ) { [weak self] notification in
+            guard let self = self else { return }
             if let ui = notification.userInfo,
                 ui["progress"] as? Int == 400,
                 let contactId = ui["contact_id"] as? Int {

+ 4 - 2
deltachat-ios/Controller/SettingsController.swift

@@ -239,7 +239,8 @@ internal final class SettingsViewController: UITableViewController {
             forName: dcNotificationImexProgress,
             object: nil,
             queue: nil
-        ) { notification in
+        ) { [weak self] notification in
+            guard let self = self else { return }
             if let ui = notification.userInfo {
                 if ui["error"] as? Bool ?? false {
                     self.hudHandler.setHudError(ui["errorMessage"] as? String)
@@ -254,7 +255,8 @@ internal final class SettingsViewController: UITableViewController {
             forName: dcNotificationConfigureProgress,
             object: nil,
             queue: nil
-        ) { notification in
+        ) { [weak self] notification in
+            guard let self = self else { return }
             if let ui = notification.userInfo {
                 if ui["error"] as? Bool ?? false {
                     self.hudHandler.setHudError(ui["errorMessage"] as? String)

+ 2 - 1
deltachat-ios/Handler/ProgressAlertHandler.swift

@@ -64,7 +64,8 @@ extension ProgressAlertHandler {
             forName: dcNotificationConfigureProgress,
             object: nil,
             queue: nil
-        ) { notification in
+        ) { [weak self] notification in
+            guard let self = self else { return }
             if let ui = notification.userInfo {
                 if ui["error"] as? Bool ?? false {
                     self.updateProgressAlert(error: ui["errorMessage"] as? String)