Fix execute_process blocking on Windows

This commit is contained in:
philippewarren 2022-03-15 13:58:20 -04:00
parent fa58db9d6e
commit b3f330bd80

View File

@ -1330,6 +1330,7 @@ private:
#ifdef __USING_WINDOWS__
HANDLE process_handle_;
std::future<void> cleanup_future_;
#endif
bool defer_process_start_ = false;
@ -1555,7 +1556,7 @@ inline void Popen::execute_process() noexcept(false)
this->process_handle_ = piProcInfo.hProcess;
std::async(std::launch::async, [this] {
this->cleanup_future_ = std::async(std::launch::async, [this] {
WaitForSingleObject(this->process_handle_, INFINITE);
CloseHandle(this->stream_.g_hChildStd_ERR_Wr);