From 15241d42c0c226a40de554c13b6e04ea132d6953 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Thu, 28 May 2015 11:05:35 +0300 Subject: [PATCH] [ios] Fix pending location stuck. --- iphone/Maps/Classes/SearchView.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iphone/Maps/Classes/SearchView.mm b/iphone/Maps/Classes/SearchView.mm index d139f64ed6..3bbd2a8254 100644 --- a/iphone/Maps/Classes/SearchView.mm +++ b/iphone/Maps/Classes/SearchView.mm @@ -186,14 +186,15 @@ static BOOL keyboardLoaded = NO; CGFloat const textFieldBackgroundWidth = cancelButtonMinX - self.searchBar.fieldBackgroundView.minX - 8; CGFloat const textFieldWidth = textFieldBackgroundWidth - 60; + LocationManager const * const locationManager = [MapsAppDelegate theApp].m_locationManager; if (state == SearchViewStateFullscreen) { self.controlsManager.hidden = YES; - [[MapsAppDelegate theApp].m_locationManager start:self]; + [locationManager start:self]; double latitude; double longitude; - bool const hasPt = [[MapsAppDelegate theApp].m_locationManager getLat:latitude Lon:longitude]; + bool const hasPt = [locationManager getLat:latitude Lon:longitude]; GetFramework().PrepareSearch(hasPt, latitude, longitude); if (keyboardLoaded) @@ -245,6 +246,7 @@ static BOOL keyboardLoaded = NO; else if (state == SearchViewStateHidden) { self.controlsManager.hidden = NO; + [locationManager stop:self]; [self.searchBar.textField resignFirstResponder]; [UIView animateWithDuration:duration delay:0 damping:damping initialVelocity:0 options:options animations:^{ self.searchBar.cancelButton.alpha = 1;