diff options
author | Rainer Schuetze <r.sagitario@gmx.de> | 2022-03-27 09:08:45 (GMT) |
---|---|---|
committer | Rainer Schuetze <r.sagitario@gmx.de> | 2022-03-27 09:08:45 (GMT) |
commit | 80b94fb12452479449a99bad9af8435031a83a73 (patch) | |
tree | adde15f6af822159e5f820615d5fbe3eebfbb1bd /src | |
parent | c99df6c1597de7cfb174ab05beb3949a63a4b8c9 (diff) | |
download | cv2pdb-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
Diffstat (limited to 'src')
-rw-r--r-- | src/mspdb.cpp | 4 |
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;
|