Note that there are some explanatory texts on larger screens.

plurals
  1. POEXC_BAD_ACCESS when checking an operation queue for duplicates
    primarykey
    data
    text
    <p>I have an NSOperationQueue in my app that handles endpoint URL requests. To avoid adding duplicate requests, wherever possible I check the queue to see whether this endpoint call is already handled. </p> <p>For some reason, generally only when the endpoint operation queue is getting spammed like hell, but also randomly at other times (implying to me that it's a very uncommon race condition of some sort), I get an EXC_BAD_ACCESS when scanning my operation queue for duplicates. It happens on the line:</p> <pre><code> if (![endpointOperation.urlRequest respondsToSelector: @selector(URL)]) { </code></pre> <p>Here's the code:</p> <pre><code>-(BOOL)operationQueueContainsDuplicateOperations { for (EndpointOperation *endpointOperation in [EndpointOperationQueueManager instance].operationQueue.operations) { if (![endpointOperation.urlRequest respondsToSelector: @selector(URL)]) { return NO; } if (![self.urlRequest respondsToSelector: @selector(URL)]) { return NO; } if ([[endpointOperation.urlRequest.URL absoluteString] isEqualToString:[self.urlRequest.URL absoluteString]] &amp;&amp; (self.relatedProfileIds &amp;&amp; [endpointOperation.relatedProfileIds isEqualToArray:self.relatedProfileIds])) { return YES; } } return NO; </code></pre> <p>}</p> <p>I thought maybe the operation queue was being modified while this loop was in process but I don't know how that would happen - and when I receive the crash, I can view the contents of the relevant objects and they look fine. Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload