Skip to content

Conversation

iCharlesHu
Copy link
Contributor

We cannot depend on calling .close() in deinit since it’s non-failable. As a result, Subprocess needs to manually call .close() at the conclusion of the read/write operation. fatalError in deinit to ensures the FileDescriptor/DispatchIO will not leak.

Resolves: #49

…een closed in deinit.

We cannot depend on calling .close() in deinit since it’s non-failable. As a result, Subprocess needs to manually call .close() at the conclusion of the read/write operation. fatalError in deinit to ensures the FileDescriptor/DispatchIO will not leak.
@iCharlesHu iCharlesHu requested review from itingliu and parkera June 12, 2025 04:58
@parkera
Copy link

parkera commented Jun 12, 2025

cc @FranzBusch @weissi

@iCharlesHu iCharlesHu merged commit c6c761e into swiftlang:main Jun 12, 2025
20 checks passed
@iCharlesHu iCharlesHu deleted the charles/surface-deinit-error branch June 12, 2025 17:39
guard self.closeWhenDone else {
return
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's still this guard self.closeWhenDone here which is probably not intended as we're never closing here (which is great)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Surface errors from closed file descriptors

3 participants