Skip to content

Commit

Permalink
Fix leaking technique (#2963)
Browse files Browse the repository at this point in the history
Using `Unmanaged.passRetained` is correct and therefore safe under all
compiler optimizations
  • Loading branch information
asdf-bro authored Nov 3, 2024
1 parent 37b31b9 commit 3fda943
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/NIOPosix/PosixSingletons.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ private let globalPosixBlockingPool: NIOThreadPool = {
numberOfThreads: NIOSingletons.blockingPoolThreadCountSuggestion,
threadNamePrefix: "SGLTN-TP-#"
)
_ = Unmanaged.passUnretained(pool).retain() // never gonna let you down.
_ = Unmanaged.passRetained(pool) // never gonna let you down.
return pool
}()

0 comments on commit 3fda943

Please sign in to comment.