Closed nicolasdejong closed 4 years ago
Turns out, this line is the culprit:
D2D.CreateBitmapFromHBitmap(this.Handle, bmp.GetHbitmap(), useAlphaChannel);
where the GetHbitmap() is not freed.
I have fixed the method and created a pull request for it.
Thanks very much!
I'm using this library for a project that opens and closes a D2DForm often. It uses GDI bitmaps to cache because they are expensive to create and I don't want to wait for that when opening the window.
I noticed the equivalent of the code below leads to a memory leak. The below code should, if I understand it correctly, have the same memory use before and after. Unfortunately that seems not to be the case:
Is this a memory leak or am I doing something wrong and is there another way to reclaim the used memory? Perhaps there is a workaround?