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)
|
#if defined(_WIN32)
|
||||||
_close(input);
|
_close(input);
|
||||||
_close(output);
|
_close(output);
|
||||||
CloseHandle(process.Process);
|
|
||||||
#else
|
#else
|
||||||
close(input);
|
close(input);
|
||||||
close(output);
|
close(output);
|
||||||
#endif
|
#endif
|
||||||
|
llvm::sys::Wait(process, /*SecondsToWait=*/0);
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadedExecutablePlugin::~LoadedExecutablePlugin() {
|
LoadedExecutablePlugin::~LoadedExecutablePlugin() {
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ swift::ExecuteWithPipe(llvm::StringRef program,
|
|||||||
close(p2.write);
|
close(p2.write);
|
||||||
llvm::sys::ProcessInfo proc;
|
llvm::sys::ProcessInfo proc;
|
||||||
proc.Pid = pid;
|
proc.Pid = pid;
|
||||||
|
proc.Process = pid;
|
||||||
return ChildProcessInfo(proc, p1.write, p2.read);
|
return ChildProcessInfo(proc, p1.write, p2.read);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,6 +278,7 @@ swift::ExecuteWithPipe(llvm::StringRef program,
|
|||||||
output[PI_READ].release();
|
output[PI_READ].release();
|
||||||
|
|
||||||
llvm::sys::ProcessInfo proc;
|
llvm::sys::ProcessInfo proc;
|
||||||
|
proc.Pid = pi.dwProcessId;
|
||||||
proc.Process = pi.hProcess;
|
proc.Process = pi.hProcess;
|
||||||
return ChildProcessInfo(proc, ifd, ofd);
|
return ChildProcessInfo(proc, ifd, ofd);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user