Skip to content

Commit

Permalink
fix(Geolocator): Stop using location when unsubscribing from events.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Louis committed Apr 27, 2023
1 parent 0edd2e3 commit 22ee956
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Uno.UWP/Devices/Geolocation/Geolocator.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,12 @@ partial void StartPositionChanged()
RestartUpdates();
}

partial void StopPositionChanged() => _positionChangedSubscriptions.TryRemove(this, out var _);
partial void StopPositionChanged()
{
_positionChangedSubscriptions.TryRemove(this, out _);
RemoveUpdates();
BroadcastStatusChanged(PositionStatus.Disabled);
}

private async Task<bool> TryWaitForGetGeopositionAsync(TimeSpan timeout, DateTime earliestDate)
{
Expand Down

0 comments on commit 22ee956

Please sign in to comment.