Skip to content

If we call an invalidate whereas we've not called a schedule method, a crash emerges  #20

@kos9kus

Description

@kos9kus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions