From 80b94fb12452479449a99bad9af8435031a83a73 Mon Sep 17 00:00:00 2001 From: Rainer Schuetze Date: Sun, 27 Mar 2022 11:08:45 +0200 Subject: fix issue #72: Hang when vswhere produces no output close write handle before reading from the pipe --- src/mspdb.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- cgit v0.12