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

ObjectReference<T> needs to support the Dispose pattern for correct CCW lifetime #37

Closed
jkoritzinsky opened this issue Dec 19, 2019 · 0 comments · Fixed by #75
Closed
Labels
fixed Issue has been fixed in an upcoming or existing release

Comments

@jkoritzinsky
Copy link
Member

jkoritzinsky commented Dec 19, 2019

To help maintain CCW lifetime across native calls, we should change WinRT.ObjectReference<T> to implement the Dispose pattern (and possibly move the release logic up to the base IObjectReference class). This will allow us to use using() blocks around the native calls to keep the ObjectReference<T> to a CCW alive across the native call.

jkoritzinsky added a commit that referenced this issue Feb 14, 2020
Implement the Dispose pattern to enable deterministic release on many cases. Fix a lifetime bug in factories that was exposed deterministically by this work.

Fixes #37
jkoritzinsky added a commit that referenced this issue Feb 18, 2020
* Implement Dispose pattern on IObjectReference.

Implement the Dispose pattern to enable deterministic release on many cases. Fix a lifetime bug in factories that was exposed deterministically by this work.

Fixes #37

* Move release up to IObjectReference.Dispose.
@angelazhangmsft angelazhangmsft added the fixed Issue has been fixed in an upcoming or existing release label May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Issue has been fixed in an upcoming or existing release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants