Close downloaded application before attempting to execute it.

CORE-8134 #resolve

svn path=/trunk/; revision=63085
This commit is contained in:
Pierre Schweitzer 2014-04-30 22:03:49 +00:00
parent 3d22f7e832
commit 9282f9855e

View file

@ -217,7 +217,7 @@ ThreadFunc(LPVOID Context)
BOOL bCab = FALSE;
HINTERNET hOpen = NULL;
HINTERNET hFile = NULL;
HANDLE hOut = NULL;
HANDLE hOut = INVALID_HANDLE_VALUE;
unsigned char lpBuffer[4096];
const LPWSTR lpszAgent = L"RApps/1.0";
@ -284,6 +284,9 @@ ThreadFunc(LPVOID Context)
}
while (dwBytesRead);
CloseHandle(hOut);
hOut = INVALID_HANDLE_VALUE;
if (bCancelled) goto end;
ShowWindow(Dlg, SW_HIDE);
@ -294,7 +297,7 @@ ThreadFunc(LPVOID Context)
ShellExecuteW( NULL, L"open", path, NULL, NULL, SW_SHOWNORMAL );
}
end:
CloseHandle(hOut);
if (hOut != INVALID_HANDLE_VALUE) CloseHandle(hOut);
InternetCloseHandle(hFile);
InternetCloseHandle(hOpen);