Open
Description
openedon Oct 10, 2022
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
- Making the RenderTargetBitmap inherit IDisposable
public class RenderTargetBitmap : IDisposable
- Add the
AsDisposable
method
public class RenderTargetBitmap
{
public IDisposable AsDisposable(){}
}
Add 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment