diff --git a/bindings/cs/UnityViewer/Assets/SurviveObject.cs b/bindings/cs/UnityViewer/Assets/SurviveObject.cs index 6676b67c..f9ed08ec 100644 --- a/bindings/cs/UnityViewer/Assets/SurviveObject.cs +++ b/bindings/cs/UnityViewer/Assets/SurviveObject.cs @@ -67,4 +67,12 @@ void Update() { updatedObject.transform.localRotation = newRotation; } } + + void OnApplicationQuit() { + if (survive != null){ + survive.Close(); + survive.Dispose(); + survive = null; + } + } }