Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadcaster.unregister(xxx.self, observer: self) (VC) #6

Open
zhaoyunyi opened this issue Mar 30, 2017 · 6 comments
Open

Broadcaster.unregister(xxx.self, observer: self) (VC) #6

zhaoyunyi opened this issue Mar 30, 2017 · 6 comments

Comments

@zhaoyunyi
Copy link

运行的时候, 注销的时候也会崩溃,之前好像不会的

@zhaoyunyi
Copy link
Author

static func safeRemove(key: String, object: AnyObject) {
    notificationQueue.async(flags: .barrier) {
        if var set = observersDic[key] as? WeakObjectSet<AnyObject> {
            set.remove(object)   / / 这句话崩溃 
            observersDic[key] = set
        }
    }
}

@100mango
Copy link
Owner

麻烦把错误的堆栈发一下。

@100mango 100mango closed this as completed Jun 7, 2018
@MakeBetterMe
Copy link

好像还是会崩溃啊

@100mango
Copy link
Owner

100mango commented Jun 1, 2020

@MakeBetterMe 麻烦提供一下可复现demo。

@MakeBetterMe
Copy link

在deinit里面unregister for self
就会触发崩溃

@100mango 100mango reopened this Jun 1, 2020
@100mango
Copy link
Owner

100mango commented Jun 1, 2020

@MakeBetterMe 感谢指出问题,后续会抽出时间定位修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants