mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Macros] Ensure reaping executable plugin process
rdar://126489446
This commit is contained in:
@@ -172,11 +172,11 @@ LoadedExecutablePlugin::PluginProcess::~PluginProcess() {
|
||||
#if defined(_WIN32)
|
||||
_close(input);
|
||||
_close(output);
|
||||
CloseHandle(process.Process);
|
||||
#else
|
||||
close(input);
|
||||
close(output);
|
||||
#endif
|
||||
llvm::sys::Wait(process, /*SecondsToWait=*/0);
|
||||
}
|
||||
|
||||
LoadedExecutablePlugin::~LoadedExecutablePlugin() {
|
||||
|
||||
@@ -187,6 +187,7 @@ swift::ExecuteWithPipe(llvm::StringRef program,
|
||||
close(p2.write);
|
||||
llvm::sys::ProcessInfo proc;
|
||||
proc.Pid = pid;
|
||||
proc.Process = pid;
|
||||
return ChildProcessInfo(proc, p1.write, p2.read);
|
||||
}
|
||||
|
||||
@@ -277,6 +278,7 @@ swift::ExecuteWithPipe(llvm::StringRef program,
|
||||
output[PI_READ].release();
|
||||
|
||||
llvm::sys::ProcessInfo proc;
|
||||
proc.Pid = pi.dwProcessId;
|
||||
proc.Process = pi.hProcess;
|
||||
return ChildProcessInfo(proc, ifd, ofd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user