final class Box<T: Sendable> {
let value: T
init(value: T) {
self.value = value
}
deinit {
print("BOX DEINIT")
}
}
final class Item {
private let test = ManagedAtomicLazyReference<Box<Int>>()
init() {
test.storeIfNilThenLoad(Box(value: 12345))
}
deinit {
print("ITEM DEINIT")
}
}
func test() {
let _ = Item()
}
//`main.swift`:
test()
// prints "ITEM DEINIT" only
ManagedAtomicLazyReference
leaks its contents.Information
.upToNextMajor(from: "1.0.0")
Checklist
main
branch of this package.Steps to Reproduce
Expected behavior
"
BOX DEINIT
" and "ITEM DEINIT
" get printed.Actual behavior
Only "
ITEM DEINIT
" gets printed.