This is very rare. Here is the last line of the stack trace:
0 libdispatch.dylib 0x0000000197a85a9c dispatch_group_leave + 48
dispatch_group_leave is called in full closure, which is called as follows:
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { () -> Void in let query = HKStatisticsCollectionQuery(quantityType: quantityType, quantitySamplePredicate: nil, options: statisticOptions, anchorDate: anchorDate, intervalComponents: interval) query.initialResultsHandler = { complete()
So, we send to the background thread, run HKStatisticsCollectionQuery, and then call the closure of the function parameter, called full. Inside complete, dispatch_group_leave is called and a crash occurs.
Any ideas are most appreciated! Thanks!
source share