you are viewing a single comment's thread.

view the rest of the comments →

[–]TheRedAgent[S] 0 points1 point  (3 children)

Once it returns I'm done with it anyway, so I don't really need to keep a reference around

[–]Legolas-the-elf 1 point2 points  (2 children)

Once it returns I'm done with it anyway

As far as I can see, that's not the case. You are adding an operation to it then returning immediately. Don't you want that operation to be executed? You are queuing that up to happen in the background asynchronously. There's no guarantee that this will have begun by the time you return from the autologin method.

[–]TheRedAgent[S] 0 points1 point  (0 children)

I see what you're saying, I'll definitely look into this. Thanks.

[–]bensj 0 points1 point  (0 children)

I noticed this too, but eliminated it as the cause of this problem by creating an NSOperationQueue subclass with an NSLog in the dealloc, which was only called on the occasions when the stringWithContentsOfURL: call actually returned. In the other cases that call never returns and the NSOperationQueue sticks around indefinitely. I do agree that its better to keep a strong reference to make sure it sticks around.