Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

annotation reload crash #7170

Closed
halset opened this issue Nov 23, 2016 · 7 comments
Closed

annotation reload crash #7170

halset opened this issue Nov 23, 2016 · 7 comments
Labels
iOS Mapbox Maps SDK for iOS

Comments

@halset
Copy link
Contributor

halset commented Nov 23, 2016

Platform: iOS
Mapbox SDK version: master as of edb487b

Steps to trigger behavior

  1. Change some property of an annotation that makes it switch between annotation image and view. Typically to make one feature moveable and the rest not.
  2. removeAnnotation + addAnnotation to tell MGLMapView to reload the annotation. Is there an other way to tell the MGLMapView to re-ask its delegate wether the annotations should be drawn as a image or with a view?

Expected behavior

The annotation should switch between image and view without problem.

Actual behavior

It sometimes work and sometimes crash with the following stack trace.

2016-11-23 14:12:49.756 MyApp[7830:52298849] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001136e934b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x000000011309f21e objc_exception_throw + 48
	2   CoreFoundation                      0x000000011361a38f -[__NSArrayM insertObject:atIndex:] + 1375
	3   Mapbox                              0x000000010de1b58e -[MGLMapView visibleAnnotationsInRect:] + 846
	4   Mapbox                              0x000000010de3356d -[MGLMapView updateAnnotationViews] + 989
	5   Mapbox                              0x000000010de32e20 -[MGLMapView notifyMapChange:] + 3488
	6   Mapbox                              0x000000010de3b9cd _ZN8MBGLView15notifyMapChangeEN4mbgl9MapChangeE + 61
	7   Mapbox                              0x000000010de3bc43 _ZThn8_N8MBGLView15notifyMapChangeEN4mbgl9MapChangeE + 35
	8   Mapbox                              0x000000010e0e7040 _ZN4mbgl3Map6renderERNS_4ViewE + 592
	9   Mapbox                              0x000000010de00078 -[MGLMapView glkView:drawInRect:] + 136
	10  GLKit                               0x0000000114967148 -[GLKView _display:] + 304
	11  Mapbox                              0x000000010de01670 -[MGLMapView updateFromDisplayLink] + 736
@friedbunny
Copy link
Contributor

Please include the specific commit hash when reporting issues with master. Thanks!

@halset
Copy link
Contributor Author

halset commented Nov 23, 2016

@friedbunny Thank you for the reminder. I have added it to the description.

@halset
Copy link
Contributor Author

halset commented Nov 23, 2016

Sorry, but it looks like the problem only happen when I reload an annotation belonging to a MGLMapView that are dismissed at (almost) the same time.. That might be too much stress going on at the same time.

@halset
Copy link
Contributor Author

halset commented Nov 23, 2016

Well, not only when the MGLMapView is dismissed.

@cammace cammace added the iOS Mapbox Maps SDK for iOS label Nov 23, 2016
@boundsj
Copy link
Contributor

boundsj commented Nov 23, 2016

@halset we've made several improvements the way view annotations are handled that are currently only in the Mapbox iOS SDK 3.4.0 release branch. Can you test using the release branch (https://github.com/mapbox/mapbox-gl-native/tree/release-ios-v3.4.0) or the latest published beta (currently https://github.com/mapbox/mapbox-gl-native/tree/release-ios-v3.4.0)? Thanks.

@halset
Copy link
Contributor Author

halset commented Nov 23, 2016

@boundsj tried with latest of the release-ios-v3.4.0 branch as of 67e079f now and it works perfect! :) Will that one go to master when 3.4.0 are released?

@friedbunny
Copy link
Contributor

friedbunny commented Nov 23, 2016

@halset Yup, we will merge the release branch back into master once the release is finalized.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

4 participants