As you've used GetHBitmap, it's become your responsibility to dispose of the object when you're finished with it. To do this, you need to use something like this:
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
public static extern bool DeleteObject(IntPtr hObject);
public static void Delete(this IntPtr value)
{
DeleteObject(value);
}
Then all you need to do on your
hBitmap
when you don't need it is call
hBitmap.Delete();