I init a new timer and before timer will schedule in some time within an execution, I call invalidate method prior to schedule, and see an error into following scope.
if (!OSAtomicTestAndSetBarrier(7, &_timerFlags.timerIsInvalidated))
{
dispatch_source_t timer = self.timer;
dispatch_async(self.privateSerialQueue, ^{
dispatch_source_cancel(timer);
ms_release_gcd_object(timer); // The error occurred !!!
});
}
I think we need to check a reference counter of *_self.timer *_or remove ms_release_gcd_object(object) dispatch_release(object) when we work in ARC.
this is a note from Spec:
IMPORTANT
If your app is built with a deployment target of OS X v10.8 and later or iOS v6.0 and later, dispatch queues are typically managed by ARC, so you do not need to retain or release the dispatch queues.