Skip to content

[5.7][Concurrency] Fix ObjC weak references to actors. #42220

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 1 commit into from
Apr 8, 2022

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Apr 6, 2022

Cherry-pick #42219 to release/5.7.

Change actor destruction to call swift_deallocClassInstance instead of swift_deallocObject. When ObjC interop is enabled, swift_deallocClassInstance will check the "pure swift deallocation" bit and call into the ObjC runtime to destruct the instance when needed. This is what clears weak references and associated objects.

rdar://91270492

@mikeash mikeash requested review from DougGregor and rokhinip April 6, 2022 19:34
@mikeash mikeash requested a review from a team as a code owner April 6, 2022 19:34
Change actor destruction to call swift_deallocClassInstance instead of swift_deallocObject. When ObjC interop is enabled, swift_deallocClassInstance will check the "pure swift deallocation" bit and call into the ObjC runtime to destruct the instance when needed. This is what clears weak references and associated objects.

rdar://91270492
(cherry picked from commit b00397c)
@mikeash
Copy link
Contributor Author

mikeash commented Apr 7, 2022

@swift-ci please test

@mikeash mikeash changed the title [Concurrency] Fix ObjC weak references to actors. [5.7][Concurrency] Fix ObjC weak references to actors. Apr 8, 2022
@mikeash mikeash merged commit 3340b1a into swiftlang:release/5.7 Apr 8, 2022
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.

2 participants