Skip to content

Commit

Permalink
Fixed infinite recursion when failing to download shield image
Browse files Browse the repository at this point in the history
If there’s no image after the shield downloading operation completes, then there’s no reason to regenerate the attributed text that would embed that image.
  • Loading branch information
1ec5 committed Dec 6, 2018
1 parent 3fb6b8f commit 1b02e6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

* The `NavigationSettings.shared` property is now accessible in Objective-C code as `MBNavigationSettings.sharedSettings`. ([#1882](https://github.com/mapbox/mapbox-navigation-ios/pull/1882))
* Fixed spurious rerouting on multi-leg routes. ([#1884](https://github.com/mapbox/mapbox-navigation-ios/pull/1884))
* Fixed a hang that occurred when failing to fetch a route shield image for display in a visual instruction banner. ([#1888](https://github.com/mapbox/mapbox-navigation-ios/pull/1888))
* Adding property `RouteController.nearbyCoordinates`, which offers similar behavior to `RouteLegProgress.nearbyCoordinates`, which the addition of step lookahead/lookbehind in multi-leg routes. ([#1883](https://github.com/mapbox/mapbox-navigation-ios/pull/1883))
* The `MGLShapeSourceOptions.lineDistanceMetrics` property has been temporarily disabled from the route line shape source due to a crash. This means it isn’t possible to set the `MGLLineStyleLayer.lineGradient` property on the route line style layers. ([#1886](https://github.com/mapbox/mapbox-navigation-ios/pull/1886))

Expand Down
1 change: 1 addition & 0 deletions MapboxNavigation/InstructionPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class InstructionPresenter {
}

private func completeShieldDownload(_ image: UIImage?) {
guard image != nil else { return }
//We *must* be on main thread here, because attributedText() looks at object properties only accessible on main thread.
DispatchQueue.main.async {
self.onShieldDownload?(self.attributedText()) //FIXME: Can we work with the image directly?
Expand Down

0 comments on commit 1b02e6f

Please sign in to comment.