Once you want cancel group, the_groupToOperationReferences contains all object,
for (id <PINOperationReference>operationReference in [_groupToOperationReferences objectEnumerator])
{
if ([_operationQueue cancelOperation:operationReference]) {
dispatch_group_leave(_group);
}
}
Execute all object's cancelOperation is so expensive, So I remove single operationReference when
single operation had finished.
If the group start, it's not necessary to nil out the containers.
Once you want cancel group, the
_groupToOperationReferences
contains all object,Execute all object's
cancelOperation
is so expensive, So I remove singleoperationReference
when single operation had finished.If the group start, it's not necessary to nil out the containers.
Just remove all objects. Thus support adding operations after completion or cancelation.