From 3fda9430aa47942930126bbbf8982ef762feb7cf Mon Sep 17 00:00:00 2001 From: Philip Brown <122590765+asdf-bro@users.noreply.github.com> Date: Sun, 3 Nov 2024 13:48:44 -0600 Subject: [PATCH] Fix leaking technique (#2963) Using `Unmanaged.passRetained` is correct and therefore safe under all compiler optimizations --- Sources/NIOPosix/PosixSingletons.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/NIOPosix/PosixSingletons.swift b/Sources/NIOPosix/PosixSingletons.swift index 0f82ff2920..5f47e25167 100644 --- a/Sources/NIOPosix/PosixSingletons.swift +++ b/Sources/NIOPosix/PosixSingletons.swift @@ -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 }()