Comments (5)
Hmm maybe there's a race condition that's causing the loop to be run more than once. I'll look into it.
If you can recreate the bug, could you check to see which object is causing the problem from the memory location (0x7ffa01ae89b8) in the debugger?
from tsclustermapview.
will do, thanks!
On Feb 11, 2015, at 01:02 , Adam Share [email protected] wrote:
Hmm maybe there's a race condition that's causing the loop to be run more than once. I'll look into it.
If you can recreate the bug, could you check to see which object is causing the problem from the memory location (0x7ffa01ae89b8) in the debugger?
—
Reply to this email directly or view it on GitHub.
from tsclustermapview.
I've also seen crashes in initAnnotationPools:
when running in the simulator, this is one of them I've seen a few times, when called from mapView:regionDidChangeAnimated:
:
if (!_clusterAnnotationsPool) {
_clusterAnnotationsPool = [[NSMutableSet alloc] initWithCapacity:numberOfAnnotationsInPool];
for (int i = 0; i < numberOfAnnotationsInPool; i++) {
ADClusterAnnotation * annotation = [[ADClusterAnnotation alloc] init];
[_clusterAnnotationsPool addObject:annotation];
}
toAdd = _clusterAnnotationsPool.allObjects; <----- here
}
The message printed to the lldb console:
Description of exception being thrown: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[450]' Warning: hit breakpoint while running function, skipping commands and conditions to prevent recursion.
And interestingly, while 180 is passed in and numberOfAnnotationsInPool
is 360, clusterAnnotationsPool
has 617 objects. Printing this object in lldb at this point shows 556 ADClusterAnnotation
objects and 61 "(null)
"! Could it be multiple threads trying to modify clusterAnnotationsPool
and corrupting it? [Answer: YES!! see the Edit at the end]
At the time of this crashed on the main thread, another thread was running the tree building queue and seems to be starting TSClusterOperation
s, I don't happen to see anything that touches clusterAnnotationsPool
.
Edit: I just saw a different crash, and both the main thread and the tree building queue were both in initAnnotationPools:
! So yes, I'd guess that these crashes are all because clusterAnnotationsPool
gets modified by multiple threads simultaneously. Should locks or similar mechanism be added to prevent this, at what level of granularity? Or is a minor redesign warranted to adjust what's done in background threads?
For now, I'm deferring my call to setRegion:animated:
on the main thread to hopefully avoid this (deferring it until the first call to mapViewDidFinishRenderingMap:
having the effect of rendering the world map then zooming in)
from tsclustermapview.
@jpmhouston thanks for pointing this out. I'll try to get out a fix asap
from tsclustermapview.
@jpmhouston Just pushed new version see if that resolves the issue
from tsclustermapview.
Related Issues (20)
- Annotations are not visible if removed and added back again HOT 2
- Sometimes a cluster annotation becomes a single annotation HOT 4
- Drag spontaneously cancelled after moving a short distance HOT 2
- Zooming out animation HOT 2
- Group annotations HOT 2
- Vanishing annotations HOT 5
- Cluster Annotations is not visible. HOT 2
- Show number produced by sum of custom data on clusters instead of number of pins in cluster HOT 1
- negative span value results in crash HOT 4
- Is there a way to intercept the click to does not expand the pins in the last zoom level? HOT 6
- How to select a clustered annotation programmatically? HOT 5
- Cluster use 200% of cpu HOT 7
- the map show nothing in release build, normal in debug build HOT 9
- The annotation disappear suddenly, sometimes swap to other annotation...happen often
- Added annotations at viewDidLoad, but they appear on map only if I resize it.
- Terminating app due to uncaught exception 'NSRangeException' HOT 1
- Annotation cannot get selected HOT 1
- tvOS support
- Clusterization broken in 3D view
- Example is broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tsclustermapview.