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

add support for identity #141

Closed
wants to merge 2 commits into from
Closed

add support for identity #141

wants to merge 2 commits into from

Conversation

stevenbrix
Copy link
Collaborator

This PR add support for object identity via the WinRTObject class.

Since WinRT Object's have to keep a strong ref to their identity, in order for it to remain valid during the lifetime of the object. I re-used the same logic we use for WinRTClass and made it more generic.

When wrapping a swift object. we check if it is a WinRTObject if it is, we store the weak reference on the wrapper. When retrieving the abi object, we check if it has identity. if it does.

Note: this intentionally doesn't require all objects that implement a WinRTInterface to also support the notion of identity. While that is probably a righteous change to eventually have, i went down that route and decided it was slightly too large of a change for now

Testing

Added a couple tests for identity and also added a memory management test to make sure we aren't leaking the WinRTObject

@stevenbrix stevenbrix requested a review from a team as a code owner February 13, 2024 18:42
@tristanlabelle tristanlabelle requested review from tristanlabelle and removed request for tristanlabelle August 12, 2024 14:53
@tristanlabelle
Copy link
Contributor

Closing due to 6 month stale and I can't remove myself from reviewers to stop receiving daily notifications in Slack. @stevenbrix , please reopen as needed.

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.

3 participants