Open lexrus opened 12 years ago
The proper way of releasing a queue is done via dispatch_release
For example,
dispatch_release( serial_queue )
Is this what you are doing?
Hi, @dewind Thank you for your reply. Yes, if the serial_queue is suspended previously then there will be a EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP...) exception. Maybe I should turn back to NSOperation so that I can stop and cancel my queue?
That is is interesting and would appear to be a bug if one can't deallocate a suspended queue. Do you have a snippet of code you'd be willing to provide?
JSGCDDispatcher *downloadQueue = [JSGCDDispatcher dispatcherWithSerialQueueID:issuesDownloadQueueID];
for (uint i = 0; i < 20; i++) {
[downloadQueue dispatchOnSerialQueue:^{
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://yahoo.com"]];
[NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSLog(@"downloaded");
}];
}
[downloadQueue submitSerialQueueCompletionListener:^{
NSLog(@"download queue complete");
}];
[downloadQueue suspendSerialQueue];
downloadQueue = nil;
It will cause a exception.