Discovered interesting SwiftUI memory leak bug in iOS 17 around creation of StateObject (FB13108791). If you pass it a value initialized not inline it will never be freed:
This works:
self._myClass = StateObject(wrappedValue: MyClass())
This causes memory leak:
let myClass = MyClass()
self._myClass = StateObject(wrappedValue: myClass)


