flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

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

Open mkurz-it opened this issue 11 months ago • 3 comments

The onDidAuthorizationChanged is executed by iOS somewhen afer CLLocationManager is created in onListenWithArguments.

If the the subscription is canceled in the meantime _eventSink (onCancelWithArguments) is set to nil leading to accessing _eventSink when already nil (BAD_ACCESS crash).

Pre-launch Checklist

  • [x] I made sure the project builds.
  • [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • [x] I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes.
  • [x] I updated CHANGELOG.md to add a description of the change.
  • [x] I updated/added relevant documentation (doc comments with ///).
  • [x] I rebased onto main.
  • [x] I added new tests to check the change I am making, or this PR does not need tests.
  • [x] I made sure all existing and new tests are passing.
  • [x] I ran dart format . and committed any changes.
  • [x] I ran flutter analyze and fixed any errors.

mkurz-it avatar Nov 27 '24 12:11 mkurz-it