Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear ivar after scheduling for main thread deallocation #trivial #590

Merged
merged 2 commits into from
Sep 27, 2017

Conversation

maicki
Copy link
Contributor

@maicki maicki commented Sep 27, 2017

After scheduling the ivar for main thread deallocation we have clear out the ivar, otherwise we can run into a race condition where the main queue is drained earlier than this node is deallocated and the ivar is still deallocated on a background thread

After scheduling the ivar for main thread deallocation we have clear out the ivar, otherwise we can run into a race condition where the main queue is drained earlier than this node is deallocated and the ivar is still deallocated on a background thread
Copy link
Member

@Adlai-Holler Adlai-Holler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. We ought to clear the ivar before sending it for main thread deallocation, or it could still run out-of-order.

Copy link
Member

@Adlai-Holler Adlai-Holler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@maicki maicki merged commit a103bab into master Sep 27, 2017
@maicki maicki deleted the MSClearMainThreadDeallocationIvar branch September 29, 2017 17:42
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
…xtureGroup#590)

* Clear ivar after scheduling for main thread deallocation

After scheduling the ivar for main thread deallocation we have clear out the ivar, otherwise we can run into a race condition where the main queue is drained earlier than this node is deallocated and the ivar is still deallocated on a background thread

* First clear and than schedule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants