diff --git a/windows-snapshot-tool/src/main.cpp b/windows-snapshot-tool/src/main.cpp index dfb59fd..4add802 100644 --- a/windows-snapshot-tool/src/main.cpp +++ b/windows-snapshot-tool/src/main.cpp @@ -430,6 +430,12 @@ int CaptureImage(HWND hWnd, const wchar_t* filename) { //Close the handle for the file that was created CloseHandle(hFile); + + // clean up + DeleteObject(hbmScreen); + DeleteObject(hdcMemDC); + ReleaseDC(NULL,hdcScreen); + ReleaseDC(hWnd,hdcWindow); return 0; }