mproberts/objc-promise — pull request #2 by phopkins (2013-05-11 03:52:29+00:00)
Title: Fix memory leaks, corruption, and warnings

This PR fixes a major issue, a minor issue, and a warning.

Most importantly, it uses the return value of Block_copy in the Promise methods. Just calling the function but ignoring its result is ineffective and does not prevent the block from being corrupted when the stack changes.

It fixes a minor refcount issue by autoreleasing the resolved / rejected return values (found via clang Analyze).

Finally, it switches from retain / release messages on the GCD queues to calling the GCD reference count methods directly, which got rid of a warning in Xcode 4.6.