You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Ignore deleting a non-existing offline region #8917
With the testapp, I was able to produce a native crash by opening Delete region example and clicking twice on an item to delete it (by accident, very fast after eachother). This resulted in deleting the same region twice. While this could be handled by the UI, I think it would be cleaner to ignore possible crashing updates or call into an onError callback instead.
I investigated this further, and I believe it is an Android-specific crash. The Android wrapper code stores an OfflineRegion object, and calls std::move when deleting:
This means that the OfflineRegion object stored in the unique_ptr is now considered invalid (since we have moved away from it) and shouldn't be used anymore. The Android JNI wrapper should protect against this and return an error (or throw) when attempting to call delete multiple times, or when trying to do other operations on an OfflineRegion object after it has been deleted (like querying information from it, or adding observers).
Activity
[-]Ignore deleting an non-existing offline region[/-][+]Ignore deleting a non-existing offline region[/+]kkaefer commentedon Jan 23, 2018
I investigated this further, and I believe it is an Android-specific crash. The Android wrapper code stores an
OfflineRegionobject, and callsstd::movewhen deleting:mapbox-gl-native/platform/android/src/offline/offline_region.cpp
Line 124 in 273a9a5
This means that the
OfflineRegionobject stored in theunique_ptris now considered invalid (since we have moved away from it) and shouldn't be used anymore. The Android JNI wrapper should protect against this and return an error (or throw) when attempting to call delete multiple times, or when trying to do other operations on anOfflineRegionobject after it has been deleted (like querying information from it, or adding observers).stale commentedon Nov 28, 2018
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.