summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2014-03-13 18:11:21 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-13 18:00:01 +0100
commit2c9f0207a7e001c13281015f047fca667e4b7e14 (patch)
treea2129ffb6f1af0e3137d47c7d392623a42ab581a
parent3d662e5f577ab472deaac4ec8e8fd76627646f67 (diff)
downloadqttools-2c9f0207a7e001c13281015f047fca667e4b7e14.tar.gz
qtd3dservice: Fix bad handle close at shutdown
The control handle event is closed by the service class destructor, and the worker thread handles are closed by their destructors. So, only directly close the emulator/phone handles at shutdown. Change-Id: I03ce660100826f350f742be6e8f6ae1403c6da05 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
-rw-r--r--src/qtd3dservice/d3dservice.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qtd3dservice/d3dservice.cpp b/src/qtd3dservice/d3dservice.cpp
index b3a29c343..06c0e9ec9 100644
--- a/src/qtd3dservice/d3dservice.cpp
+++ b/src/qtd3dservice/d3dservice.cpp
@@ -392,9 +392,12 @@ bool D3DService::start()
qDeleteAll(workers);
- foreach (HANDLE handle, waitHandles) {
- if (handle)
- CloseHandle(handle);
+ // Close the phone and emulator handles
+ for (int i = 0; i <= emulatorNames.size(); ++i) {
+ if (GetThreadId(waitHandles[i + 1]))
+ delete deviceWorkers.at(i);
+ else
+ CloseHandle(waitHandles[i + 1]);
}
return true;