DispatchSource crash under swift 6

This is the same issue brought up here, and this is the explanation for why this is happening. Marking the closure passed to setCancelHandler as @Sendable will fix this issue.

2 Likes