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

[#1240] Fix crash under Windows #1358

Merged
merged 1 commit into from
Oct 25, 2023
Merged

[#1240] Fix crash under Windows #1358

merged 1 commit into from
Oct 25, 2023

Conversation

jherkel
Copy link
Contributor

@jherkel jherkel commented Oct 24, 2023

Try to fix program crash under Windows. I found this link
https://stackoverflow.com/a/35838740/5325152 where are some hints. i.e "These are both very low-level Windows error codes. Whatever fails is either very far removed from your code, roughly the device driver level. Or it is an error code that was re-used by intermediary software layers, a very common crime in WinRT...". So this patch doesn't solve a real reason why a position cannot be acquired but protect a program from crashing and reports error code (also message but as you can read in linked stackoverflow article error code is more descriptive)

List at least one fixed issue.
fix #1240

Pre-launch Checklist

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

@mvanbeusekom
Copy link
Member

Hi @jherkel,

Thank you very much for diving into this issue and creating this PR. I have been doing some research myself the last week and I agree with your solution.

Would you mind increasing the version number in the pubspec.yaml and adding a new entry to the CHANGELOG.md for the geolocator_windows package? A patch update should be sufficient.

Copy link
Member

@mvanbeusekom mvanbeusekom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you very much for this contribution

@mvanbeusekom mvanbeusekom merged commit 322eaf6 into Baseflow:main Oct 25, 2023
hatch01 pushed a commit to onyx-lyon1/flutter-geolocator that referenced this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows / Desktop getCurrentPosition without Network Causes Crash
2 participants