From c0e6eb0e2b3e14ce425f45fe9c6e5af9105e4066 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Wed, 18 Jul 2018 23:24:29 +0200 Subject: [PATCH] clean up --- windows-snapshot-tool/src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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; }