vendredi 26 février 2016

HDC memory leak

Not sure why but im using Deleaker plugin to detect memory leaks. in my code in debug build its saying i have amemory leak at GetDC Then in release build it is saying i have a leak at CreateCompatibleDC

are these real leaks or false? my delete objects are called when my class closes.

    HDC hdc = GetDC(_hWnd);
    _hdcMem = CreateCompatibleDC(hdc);
    HBITMAP hbmOld = (HBITMAP)SelectObject(_hdcMem, _hBitmap);

    while (_execute.load(std::memory_order_acquire)) 
    {
        func();

        BitBlt(hdc, 0, 0, _Width, _Height, _hdcMem, 0, 0, SRCCOPY);
    }

    SelectObject(_hdcMem, hbmOld);
    DeleteDC(_hdcMem);
    DeleteObject(hbmOld);
    DeleteObject(_hBitmap);
    DeleteDC(hdc);

Aucun commentaire:

Enregistrer un commentaire