Hello, my question isn't exactly about DirectX, but about Win32 API. But DX is the most related among these foruns.
I have a function which returns a handle to a DIB, which is treated as a HBITMAP.
HBITMAP hbitmap = GetHDIBFromPicture(/* arguments are irrelevant */);
After that, I lock the HBITMAP, get a pointer to DIB and read it.
LPBYTE lpDIB = (LPBYTE) GlobalLock( hbitmap );
// ...read the DIB and COPY it pixels to another array
GlobalUnlock( hbitmap );
Then, I release the handle through DeleteObject function.
But every time I call all those codes above, which all belongs to a procedure, the memory consumed by the process is increased, it keep increasing each time. It seems that the memory allocated by the GetHDIBFromPicture(...) function to create a DIB isn't desalocated by DeleteObject().
I have no further information about that function, because it is poorly documented, but if someone knows any other function to release the allocated DIB, I will thanks.
Is it possible to release the DIB allocated by a function?