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
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.
The text was updated successfully, but these errors were encountered:
kos9kus
changed the title
If we call a invalidate whereas we've not called a schedule method, a crash emerges
If we call an invalidate whereas we've not called a schedule method, a crash emerges
Feb 3, 2016
Did you get that ?
I repeat that, my case is I initialize a timer then inside my class there are exist 2 callbacks, success and error, If i get error callback, there will be invalidating timer, if i get success callback there will be scheduling timer. An error occurs when we try to invalidate a timer that wasn't scheduled.
Please give me some feedback or tips! Perhaps I should do some check whether timer was scheduled or not.
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.
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.
The text was updated successfully, but these errors were encountered: