-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[API Proposal] Making the RenderTargetBitmap inherit IDisposable #7177
Comments
Or we should add the IDisposable to all BitmapSource ? |
In the context of CefSharp every time the |
Funnily I was looking into this couple of days back. It needs to be said that introducing So we need to make a decision whether we are OK introducing such breaking change, or whether we want to work around that. Personally at the moment I would not be opposed too much to a breaking change here. For workarounds, I do not like the There is also a 3rd option, which is to figure out why RTB and WB are running in these issues in the first place, for example, are they not adding enough GC pressure? Finally, while this change looks easy in principle, there is couple of things that need to be figured out. Suddenly you can have disposed yet alive classes around and that has consequences. All the classes would need to be sprinkled with checks and |
As an api consumer I see little problems in adding using in new places or even disable analyser warnings IF need be. As long as the changes arrive in a major version like net8! |
I think so too |
The RenderTargetBitmap will cature the
_wicSource
handler which will release slowly by GC. WPF will throw COM Exception when create RenderTargetBitmap too fast.Making the RenderTargetBitmap inherit IDisposable. Developers can better control the release of memory.
API Proposal
AsDisposable
methodAdd the
AsDisposable
method can make the Analyzer happy. The Analyzer will not keep alerting that the IDisposable object may be a potential memory leak.See #3067 (comment)
The text was updated successfully, but these errors were encountered: