Skip to content

Commit bf4289c

Browse files
Fix execute_process blocking on Windows (#76)
1 parent 2bec886 commit bf4289c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subprocess.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ class Popen
13301330

13311331
#ifdef __USING_WINDOWS__
13321332
HANDLE process_handle_;
1333+
std::future<void> cleanup_future_;
13331334
#endif
13341335

13351336
bool defer_process_start_ = false;
@@ -1555,7 +1556,7 @@ inline void Popen::execute_process() noexcept(false)
15551556

15561557
this->process_handle_ = piProcInfo.hProcess;
15571558

1558-
std::async(std::launch::async, [this] {
1559+
this->cleanup_future_ = std::async(std::launch::async, [this] {
15591560
WaitForSingleObject(this->process_handle_, INFINITE);
15601561

15611562
CloseHandle(this->stream_.g_hChildStd_ERR_Wr);

0 commit comments

Comments
 (0)