summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-10-10 10:20:11 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-10-10 14:13:28 +0000
commit20d14f201e2066b3d738dd15e5cb1ca3b1d2f925 (patch)
tree1a4517bb1e68838735805cd394a890ee01ed9a16
parentd54b8e3ade43344fa18bc26c0f965432553cf888 (diff)
downloadqttools-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.cpp3
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.