Skip to content

Commit cb727c1

Browse files
authored
Windows: Do not close process handle in Process#close (#13997)
1 parent c7bd41d commit cb727c1

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

spec/std/process_spec.cr

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,7 @@ describe Process do
333333
{% end %}
334334
end
335335

336-
# TODO: this spec gives "WaitForSingleObject: The handle is invalid."
337-
# is this because standard streams on windows aren't async?
338-
pending_win32 "can link processes together" do
336+
it "can link processes together" do
339337
buffer = IO::Memory.new
340338
Process.run(*stdin_to_stdout_command) do |cat|
341339
Process.run(*stdin_to_stdout_command, input: cat.output, output: buffer) do

src/process.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ class Process
328328
Process::Status.new(@process_info.wait)
329329
ensure
330330
close
331+
@process_info.release
331332
end
332333

333334
# Whether the process is still registered in the system.
@@ -346,7 +347,6 @@ class Process
346347
close_io @input
347348
close_io @output
348349
close_io @error
349-
@process_info.release
350350
end
351351

352352
# Asks this process to terminate.

0 commit comments

Comments
 (0)