How to shut down ARKit completely

Hello, I was wondering if anyone knew how to shut down ARKit correctly.


I am using ARKit as a feature in my application, but when I leave "shut down" ARKit using ARSession.pause and then dismiss the view controller with my ARSCNView in it, I see that a CoreMotion thread is still active on the CPU.


Is this a bug or an expected behavior? Furthermore, is there no other method other than the pause function to kill ARKit or is it expected that once the view controller is dimissed that all the relevant components of it will be destroyed via the garbage collector?


Any help is appreciated.

Post not yet marked as solved Up vote post of GR_ Down vote post of GR_
2.3k views

Replies

The ARKit lifecycle [ https://developer.apple.com/documentation/arkit/managing_session_lifecycle_and_tracking_quality] doesn't include killing ARKit outright. Best to revisit your expectations about shutting it down completely yourself and work with the API as designed, I think.


My opinion is that what you're seeing is expected behavior and yes, the system should kill as needed. Suggest you file a bug and see what comes back, being sure to add your report # to your thread for reference, thanks and good luck.