Skip to content

[API Proposal] Making the RenderTargetBitmap inherit IDisposable #7177

Open

Description

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

  1. Making the RenderTargetBitmap inherit IDisposable
public class RenderTargetBitmap : IDisposable
  1. 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

Metadata

Assignees

No one assigned

    Labels

    API suggestionEarly API idea and discussion, it is NOT ready for implementation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions