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

Fix retain cycles in RouteMapViewController #74

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions MapboxNavigation/RouteMapViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ class RouteMapViewController: UIViewController {
self.navigationView.statusView.canChangeValue = self.routeController?.locationManager is SimulatedLocationManager
guard let destination = self.route?.legs.last?.destination else { return }

self.populateName(for: destination, populated: { self.destination = $0 })
self.populateName(for: destination, populated: { [weak self] waypoint in
self?.destination = waypoint
})
}
}

Expand Down Expand Up @@ -889,7 +891,9 @@ private extension RouteMapViewController {

func resetETATimer() {
self.removeTimer()
self.updateETATimer = Timer.scheduledTimer(timeInterval: 30, target: self, selector: #selector(self.updateETA), userInfo: nil, repeats: true)
self.updateETATimer = Timer.scheduledTimer(withTimeInterval: 30, repeats: true) { [weak self] _ in
self?.updateETA()
}
}

func showRouteIfNeeded() {
Expand Down
Loading