We have an app where we can enable and disable AR. Also we are creating a session and destroying a session. But inside the SpatialAnchorManager.cs class the manager subscribes to the static event ARSession.stateChanged += ARSession_stateChanged; in CreateSessionAsync function and never unsubscribes from it.
So possible solution is to add ARSession.stateChanged -= ARSession_stateChanged; inside DestroySession.
Steps to reproduce the issue
Call CreateSession
Call DestroySession
Call CreateSession
-> Now we are subscribed two times to ARSession.stateChanged
We have an app where we can enable and disable AR. Also we are creating a session and destroying a session. But inside the SpatialAnchorManager.cs class the manager subscribes to the static event ARSession.stateChanged += ARSession_stateChanged; in CreateSessionAsync function and never unsubscribes from it.
So possible solution is to add ARSession.stateChanged -= ARSession_stateChanged; inside DestroySession.
Steps to reproduce the issue Call CreateSession Call DestroySession Call CreateSession
-> Now we are subscribed two times to ARSession.stateChanged
SDK Anchors 2.8.1 Unity 2020.2.1