Fix leaking technique (#2963)

Using `Unmanaged.passRetained` is correct and therefore safe under all
compiler optimizations
This commit is contained in:
Philip Brown authored and GitHub committed 2024-11-03 19:48:44 +00:00
1 parent 37b31b95c2
commit 3fda9430aa
1 file changed
+1 -1
+1 -1
View File
@@ -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
}()