-
Notifications
You must be signed in to change notification settings - Fork 1
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
AsBitmap Leaks Memory #17
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When using
AsBitmap()
it leaks memory and causes application failures that depend on theBitmap
object. This is due to the custom pointer we create and manually setting the stride.Reproduction Steps
Load a large raw image using the following algorithm
The above code will still leak even if you manually managed the
IDisposable
and implement this inside of a wrapper. Once you start zooming in on the bitmap in the UI application it will quickly run out of memoryWorkaround
The best workaround I could find was converting the image to a
Bitmap
saving it to disk and then loading the.bmp
file into memory and returning it.The text was updated successfully, but these errors were encountered: