浏览代码

fixed retain cycle newChatViewController

nayooti 5 年之前
父节点
当前提交
a842fb3f47
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      deltachat-ios/Controller/NewChatViewController.swift

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

@@ -96,7 +96,8 @@ class NewChatViewController: UITableViewController {
             forName: dcNotificationSecureJoinerProgress,
             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.hud?.error(ui["errorMessage"] as? String)