summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Schuetze <r.sagitario@gmx.de>2022-03-27 09:08:45 (GMT)
committerRainer Schuetze <r.sagitario@gmx.de>2022-03-27 09:08:45 (GMT)
commit80b94fb12452479449a99bad9af8435031a83a73 (patch)
treeadde15f6af822159e5f820615d5fbe3eebfbb1bd
parentc99df6c1597de7cfb174ab05beb3949a63a4b8c9 (diff)
downloadcv2pdb-80b94fb12452479449a99bad9af8435031a83a73.zip
cv2pdb-80b94fb12452479449a99bad9af8435031a83a73.tar.gz
cv2pdb-80b94fb12452479449a99bad9af8435031a83a73.tar.bz2
fix issue #72: Hang when vswhere produces no output
close write handle before reading from the pipe
-rw-r--r--src/mspdb.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mspdb.cpp b/src/mspdb.cpp
index 9f23d15..b402c62 100644
--- a/src/mspdb.cpp
+++ b/src/mspdb.cpp
@@ -202,6 +202,7 @@ bool tryLoadMsPdbVSWhere(const char* mspdb)
{
CloseHandle(processInformation.hProcess);
CloseHandle(processInformation.hThread);
+ CloseHandle(write);
DWORD length;
if (ReadFile(read, buffer, sizeof(buffer) - 1, &length, NULL))
@@ -210,8 +211,9 @@ bool tryLoadMsPdbVSWhere(const char* mspdb)
vsPath += buffer;
}
}
+ else
+ CloseHandle(write);
CloseHandle(read);
- CloseHandle(write);
rtrim(vsPath);
if (vsPath.empty())
return false;