DZNWebViewController
DZNWebViewController copied to clipboard
Dismissing during page load causes KVO crash
Steps to reproduce
Somewhat intermittent, but:
- Present
DZNWebViewController
modally within a navigation controller - Before its URL is loaded, press "Done"
Expected results
View controller is dismissed
Actual results
Crash due to premature destruction of object with key-value observers still attached:
Fatal Exception: NSInternalInconsistencyException An instance 0x16611fe0 of class UINavigationBar was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x16617a60> ( <NSKeyValueObservance 0x17935770: Observer: 0x165f1480, Key path: hidden, Options: <New: YES, Old: NO, Prior: NO> Context: 0x172068, Property: 0x165f93c0> <NSKeyValueObservance 0x17937b30: Observer: 0x165f1480, Key path: center, Options: <New: YES, Old: NO, Prior: NO> Context: 0x172068, Property: 0x17937b60> <NSKeyValueObservance 0x16617a10: Observer: 0x165f1480, Key path: alpha, Options: <New: YES, Old: NO, Prior: NO> Context: 0x172068, Property: 0x16617a40> )
All the observers are instances of DZNWebViewController
.
Have you found solution? Actually i have got this crash once and i am not able to reproduce this. Are you able to reproduce this now?
Sorry, haven't taken time to investigate.
On Mon, Jun 6, 2016 at 3:03 AM Sahana Kini [email protected] wrote:
Have you found solution?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dzenbot/DZNWebViewController/issues/50#issuecomment-223882633, or mute the thread https://github.com/notifications/unsubscribe/AAbHOXx-KFfUKGTtKigvdePqbUhBXfaJks5qI8YkgaJpZM4IqAlR .
Maybe one quick solution is to disable interactivity while the view is presented?
We have seen this crash as well. I've changed the navigationBar property of DZNWebViewController to strong and also migrated all references to self in the dealloc function to iVars. If crashlytics from the next release shows no further such crashes, I may commit the change to github.
Hi. Any updates?
We will release next week, and I'd give it another week to see no crashes in production. So, in another 2 weeks I may commit. The changes mentioned above won't hurt anything, so you may as well give them a try if it is urgent. I just didn't want to commit until I knew for sure.
Crashlytics was showing at least one crash a day. Now after a week it hasn't shown any. I'm ready to contribute the fix to DZNWebViewController, but I'll need help as this is my first time. I tried to push a new branch with the changes but I don't think I have permission. (Once I can push the branch, I was planning to make a pull request) Could somebody give me permissions to contribute? Thanks!
Any updates?
When comparing my changes against HEAD, some of them were already done. Since I wasn't able to push to the repository, and unable to create a pull request, I'll just post a screenshot of my changes below.
I'm still experiencing this problem with latest 3.2. Most notably, it looks like the suggestion to change UINavigationBar from weak to strong was never made. Getting a few of these crashes a day right now. Will there be a new release with these changes?