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

Prevent Over Releasing of IStream #8148

Merged
merged 6 commits into from
Nov 9, 2022
Merged

Prevent Over Releasing of IStream #8148

merged 6 commits into from
Nov 9, 2022

Conversation

lonitra
Copy link
Member

@lonitra lonitra commented Nov 9, 2022

Addresses #8105 (comment)
Update Dispose(bool disposing) methods for AxHost.State and DataStreamFromComStream to avoid releasing COM references on finalizer thread.

Ensure _comStream in DataStreamFromComStream does not get over released

  • Add field indicating whether DataStreamFromComStream takes ownership of the stream passed into constructor
  • Check if DataStreamFromComStream owns the stream before releasing
  • Do not take ownership of _comStream in DataStreamFromComStream and remove its finalizer
Microsoft Reviewers: Open in CodeFlow

@lonitra lonitra requested a review from a team as a code owner November 9, 2022 17:47
@ghost ghost assigned lonitra Nov 9, 2022
@lonitra lonitra changed the title Avoid Releasing COM References From Finalizer Thread Prevent Over Releasing of IStream Nov 9, 2022
@lonitra lonitra merged commit 70a0680 into dotnet:main Nov 9, 2022
@lonitra lonitra deleted the releasecom branch November 9, 2022 22:22
@ghost ghost added this to the 8.0 Preview1 milestone Nov 9, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants