Fix dangerous usage of error pointer
Fix dangerous usage of error pointer

error ISN'T a NSError* with __block storage.
error IS a pointer to an NSError __autoreleasing* with automatic storage.

So capturing error in a block does capture a pointer to an object with automatic storage duration (on the stack). As the block will be executed asynchronously, dereferencing error would refer to an object outside of its lifetime, which is undefined behavior.
magnetsystems/AFIncrementalStore,nataliq/AFIncrementalStore,callzhang/AFIncrementalStore