This repository has been archived by the owner on Jan 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
1 changed file
with
13 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters