Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-1694

[iOS]: View controller not properly unregistered in CDVURLProtocol

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 2.2.0
    • cordova-ios
    • None
    • Xcode 4.5 / OS X 10.7.5 (Lion) / Commit b74752f42da53532150d17aab80c0c6ae36a1a69

    Description

      [CDVURLProtocol unregisterViewController:] does not properly unregister the Cordova view controller from gRegisteredControllers. The view controller is registered in gRegisteredControllers with its "long long" representation, but it's unregistered by attempting to remove the view controller object itself from the list, which of course is not in the set.

      This causes a crash (EXC_BAD_ACCESS) in my test app (which removes and re-creates the view controller through a plugin), because something seems to call /!gap_exec again after my view controller has been deallocated. I'm not sure if that points to a bigger problem or not. But at any rate, when I change [CDVURLProtocol unregisterViewController:] to properly remove the view controller from the set, my app never crashes, through multiple recycles of the view controller.

      I can attach my sample app, if that's helpful to understanding the crash scenario. But the unregister bug is unambiguous, so we could just fix that.

      Attachments

        Activity

          People

            agrieve Andrew Grieve
            khawkins@salesforce.com Kevin Hawkins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2m
                2m
                Remaining:
                Remaining Estimate - 2m
                2m
                Logged:
                Time Spent - Not Specified
                Not Specified