[ios] Closes #534 - compass in search is not working when my position was enabled on the main map.

The problem was that location manager didn't correctly added more than one observers
This commit is contained in:
Alex Zolotarev 2012-02-07 17:10:46 +03:00 committed by Alex Zolotarev
parent 1dd6e78eb4
commit 4009b2c556

View file

@ -58,14 +58,17 @@
[observer onLocationStatusChanged:location::ENotSupported];
}
else
{
[m_observers addObject:observer];
[observer onLocationStatusChanged:location::EStarted];
}
}
- (void)stop:(id <LocationObserver>)observer
{
[m_observers removeObject:observer];
if (m_isStarted)
{
[m_observers removeObject:observer];
if ([m_observers count] == 0)
{ // stop only if no more observers are subsribed
m_isStarted = NO;