diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-10-10 10:20:11 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-10-10 14:13:28 +0000 |
commit | 20d14f201e2066b3d738dd15e5cb1ca3b1d2f925 (patch) | |
tree | 1a4517bb1e68838735805cd394a890ee01ed9a16 | |
parent | d54b8e3ade43344fa18bc26c0f965432553cf888 (diff) | |
download | qttools-20d14f201e2066b3d738dd15e5cb1ca3b1d2f925.tar.gz |
windeployqt: Fix temporary file leak
Set FILE_FLAG_DELETE_ON_CLOSE on the files used
for redirectoring process outputs.
Task-number: QTBUG-56268
Change-Id: Ia0b25ed9067e0a40a9b83dc7d10a9cf15ac63b70
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
-rw-r--r-- | src/windeployqt/utils.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/windeployqt/utils.cpp b/src/windeployqt/utils.cpp index a29b38bbd..7dd19ae07 100644 --- a/src/windeployqt/utils.cpp +++ b/src/windeployqt/utils.cpp @@ -197,7 +197,8 @@ static HANDLE createInheritableTemporaryFile() securityAttributes.bInheritHandle = TRUE; return CreateFile(name, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, &securityAttributes, - TRUNCATE_EXISTING, FILE_ATTRIBUTE_TEMPORARY, NULL); + TRUNCATE_EXISTING, + FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, NULL); } // runProcess helper: Rewind and read out a temporary file for stdout/stderr. |