Skip to content

OperationQueue.main dangling pointer fix #1094

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

Merged
merged 4 commits into from
Jul 6, 2017

Conversation

bubski
Copy link
Contributor

@bubski bubski commented Jul 2, 2017

Calling OperationQueue.main would
instantiate an OperationQueue,
set an Unmanaged reference to it as main queue specific
and return OperationQueue.

Subsequent calls to OperationQueue.main would
get the Unmanaged reference to OperationQueue from main queue specific
and return OperationQueue wrapped in Unmanaged.

However, there's nothing stopping the OperationQueue from being deallocated, so the Unmanaged reference from subsequent call would in fact return garbage.

@parkera
Copy link
Contributor

parkera commented Jul 6, 2017

@swift-ci test and merge

@swift-ci swift-ci merged commit 575a9a0 into swiftlang:master Jul 6, 2017
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.

4 participants