mirror of
https://github.com/apple/swift-nio.git
synced 2026-05-20 20:30:36 +00:00
### Motivation: In reviewing a copy of this file in swift-log, @czechboy0 noticed that the call to `pthread_mutexattr_destroy` is missing. Since pthread_mutexattr_t is like allocated on the stack rather than heap on most platforms, this is likely not a memory leak. But for correctness the missing destroy call should be added. This change is the start of a resolution [requested](https://github.com/apple/swift-log/pull/398#discussion_r2689459360) in a corresponding Lock rollout in swift-log ### Modifications: - Added missing call to `pthread_mutexattr_destroy` - Duplicated test for `NIOLock` to also test `Lock`, as a sanity test. ### Result: The new sanity test passes. If there are other ways this change can be realistically verified as safe and proper, please feel free to provide feedback in the PR.