Hi,
In the scanning objects using object capture project, when the content view is dismissed the AppDataModel is always retained and the deinit is never called.
@StateObject var appModel: AppDataModel = AppDataModel.instance
I am presenting the contentView using a UIHostingController
let hostingController = UIHostingController(rootView: ContentView())
hostingController.modalPresentationStyle = .fullScreen
present(hostingController, animated: true)
I have tried to manually detach the listeners and setting the objectCaptureSession to nil.
In the debug memory graph there is a coachingoverlay retaining the AppDataModel.
I want to remove the appModel from memory when the contentView is dismissed.
Any suggestions?