I am experiencing memory leaks when I run the following GDI code:
HDC hdcScreen = GetDC(NULL);
HDC hdcMem = CreateCompatibleDC(hdcScreen);
HBITMAP hbmpOld = (HBITMAP) SelectObject(hdcMem, hBmp);
SelectObject(hdcMem, hbmpOld);
DeleteDC(hdcMem);
ReleaseDC(NULL, hdcScreen);
I already looked at similar threads like this one , but I could not find the problem. Any help would be appreciated.
DeleteDC, the return value of ReleaseDC was checked as true (no errors).
Thanks, Tal.
source
share