skgrush / CavernSeer

An iPadOS and iOS application for scanning 3D spaces
MIT License
32 stars 9 forks source link

Fix expensive view lifespans that are continuing in the background #5

Open skgrush opened 3 years ago

skgrush commented 3 years ago

At the very least, the ScannerModel#arView is living in the background even when not in use. This indicates two potential problems: (1) we may be using the camera in the background unnecessarily, which is not great for resources and possibly privacy; (2) what other views might we be leaving around when unused, is my understanding of views fundamentally flawed?

skgrush commented 3 years ago

Answer to the first point, not only is the ARView sticking around and using the camera, it's also using significant resources even while the UI seems completely passive! So this absolutely needs to be addressed.

skgrush commented 3 years ago

In 1ef7b16 I prevented the ARView instance from persisting in the background, which clears up the confusion of using the camera in the background but still seems to keep a good chunk of memory allocated after it should have deallocated.