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

Swift KVO crash after deinit #40

Open
Maru-zhang opened this issue Dec 27, 2017 · 5 comments
Open

Swift KVO crash after deinit #40

Maru-zhang opened this issue Dec 27, 2017 · 5 comments

Comments

@Maru-zhang
Copy link

hello, in your demo project, the view controller would't be released(memery leak).After I added unowned self, the view controller has deinit, but demo will crash. It will append <= iOS11, it's look like system bug.

@jcavar
Copy link
Owner

jcavar commented Jan 2, 2018

Is this when you go back while pull to refresh is loading? I think weak self should help in this situation.

@Maru-zhang
Copy link
Author

I'm afraid not.I tried, but it still crash.You can try this on any simulator that <= iOS11.

@Maru-zhang
Copy link
Author

The reason is the ScrollView own a NSKeyValueObservation instance that observer the same ScrollView.But on iOS11, That all work.

@darekxan
Copy link

Same here

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7ff436072600 of class UITableView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x608000427ce0> (
<NSKeyValueObservance 0x6080004417a0: Observer: 0x610000478780, Key path: contentOffset, Options: <New: NO, Old: NO, Prior: NO> Context: 0x0, Property: 0x61000044d500>
)'

@jcavar
Copy link
Owner

jcavar commented Feb 21, 2018

Are you able to reproduce this consistently?

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