Index: src/platform/POSIX/OFSubprocess.m ================================================================== --- src/platform/POSIX/OFSubprocess.m +++ src/platform/POSIX/OFSubprocess.m @@ -375,11 +375,13 @@ - (void)close { if (_readPipe[0] == -1) @throw [OFNotOpenException exceptionWithObject: self]; - [self closeForWriting]; + if (_writePipe[1] != -1) + [self closeForWriting]; + close(_readPipe[0]); if (_pid != -1) { kill(_pid, SIGTERM); waitpid(_pid, &_status, WNOHANG); Index: src/platform/Windows/OFSubprocess.m ================================================================== --- src/platform/Windows/OFSubprocess.m +++ src/platform/Windows/OFSubprocess.m @@ -381,11 +381,13 @@ - (void)close { if (_readPipe[0] == NULL) @throw [OFNotOpenException exceptionWithObject: self]; - [self closeForWriting]; + if (_writePipe[1] != NULL) + [self closeForWriting]; + CloseHandle(_readPipe[0]); if (_handle != INVALID_HANDLE_VALUE) { TerminateProcess(_handle, 0); CloseHandle(_handle);