close handle
@@ -600,6 +600,7 @@ fptr_finalize(mrb_state *mrb, struct mrb_io *fptr, int quiet)
if (WaitForSingleObject(h, INFINITE) && GetExitCodeProcess(h, &status))
if (!quiet)
io_set_process_status(mrb, fptr->pid, (int)status);
+ CloseHandle(h);
#endif
fptr->pid = 0;
/* Note: we don't raise an exception when waitpid(3) fails */
