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

[geolocator_apple] Crash if listen/cancel is executed in quick succession #1612

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions geolocator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 13.0.3

- Updates dependency on geolocator_apple.

## 13.0.2

- Updates dependency on geolocator_apple to version 2.3.8.
Expand Down
2 changes: 1 addition & 1 deletion geolocator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: geolocator
description: Geolocation plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API for generic location (GPS etc.) functions.
repository: https://github.com/baseflow/flutter-geolocator/tree/main/geolocator
issue_tracker: https://github.com/baseflow/flutter-geolocator/issues?q=is%3Aissue+is%3Aopen
version: 13.0.2
version: 13.0.3

environment:
sdk: ">=2.15.0 <4.0.0"
Expand Down
4 changes: 4 additions & 0 deletions geolocator_apple/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.3.8+2

* Crash if listen/cancel is executed in quick succession

## 2.3.8+1

* HOT FIX: Adds back implementation of the `stopListening` method in the `GeolocationHandler.m` file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ - (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatu
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
BOOL isEnabled = [CLLocationManager locationServicesEnabled];
dispatch_async(dispatch_get_main_queue(), ^(void) {
if (isEnabled) {
self->_eventSink([NSNumber numberWithInt:(ServiceStatus)enabled]);
} else {
self->_eventSink([NSNumber numberWithInt:(ServiceStatus)disabled]);
if (_eventSink != nil) {
if (isEnabled) {
self->_eventSink([NSNumber numberWithInt:(ServiceStatus) enabled]);
} else {
self->_eventSink([NSNumber numberWithInt:(ServiceStatus) disabled]);
}
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion geolocator_apple/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: geolocator_apple
description: Geolocation Apple plugin for Flutter. This plugin provides the Apple implementation for the geolocator.
repository: https://github.com/baseflow/flutter-geolocator/tree/main/geolocator_apple
issue_tracker: https://github.com/baseflow/flutter-geolocator/issues?q=is%3Aissue+is%3Aopen
version: 2.3.8+1
version: 2.3.8+2

environment:
sdk: ">=2.15.0 <4.0.0"
Expand Down