Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Dismissing during page load causes KVO crash #50

Open
bgerstle opened this issue May 30, 2016 · 10 comments
Open

Dismissing during page load causes KVO crash #50

bgerstle opened this issue May 30, 2016 · 10 comments

Comments

@bgerstle
Copy link

Steps to reproduce

Somewhat intermittent, but:

  1. Present DZNWebViewController modally within a navigation controller
  2. 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.

@sahana-kini
Copy link

sahana-kini commented Jun 6, 2016

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?

@bgerstle
Copy link
Author

bgerstle commented Jun 6, 2016

Sorry, haven't taken time to investigate.

On Mon, Jun 6, 2016 at 3:03 AM Sahana Kini notifications@github.com wrote:

Have you found solution?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#50 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAbHOXx-KFfUKGTtKigvdePqbUhBXfaJks5qI8YkgaJpZM4IqAlR
.

@dzenbot
Copy link
Owner

dzenbot commented Jul 3, 2016

Maybe one quick solution is to disable interactivity while the view is presented?

@chriswoolfe
Copy link

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.

@mengjang
Copy link

mengjang commented Sep 7, 2016

Hi. Any updates?

@chriswoolfe
Copy link

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.

@chriswoolfe
Copy link

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!

@O-mkar
Copy link

O-mkar commented Nov 2, 2016

Any updates?

@chriswoolfe
Copy link

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.
image

@JasonTartaglia
Copy link

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?

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

No branches or pull requests

7 participants