I'd like to know what is the proper way to dealloc an ivar NSOperationQueue in case it has still some operations running, which can typically occur when the user suddenly quits the app. In some examples I saw the waitUntilAllOperationsAreFinished was used, like this:
- (void)dealloc {
[_queue cancelAllOperations];
[_queue waitUntilAllOperationsAreFinished];
[_queue release];
...
however many suggest to avoid doing so since it would hang the run loop. So what is the proper way to release the _queue
? And what happens if I don't wait for operations to be finished and just go on with the release?