AFNetworking/AFNetworking — pull request #302 by kirsplatrick (2012-04-14 21:00:55+00:00)
Title: Fixed a leak of AFHTTPRequestOperation in setCompletionBlock:

This is to fix a leak that was introduced when I submitted the pull request #288. The `setCompletionBlock:` method was creating a retain cycle for the operation and so the operation was never being deallocated.

The way this was fixed was to add a reference to self that is declared as `__block` variabel so that it would not be retained by the block. Also a local reference to the `_onceToken` was made since accessing an instance variable by reference within a block also retains self.

Credit goes to @note173 who found the issue (#301) and proposed the fix that is in this pull request.