//Close any ongoing Session void OnDisable() { if (smoother3D != null) { for (int i = 0; i < MaxHands; i++) { if (smoother3D[i] != null) { for (int j = 0; j < MaxJoints; j++) { smoother3D[i][j].Dispose(); smoother3D[i][j] = null; } } } smoother3D = null; } if (smoother != null) { smoother.Dispose(); smoother = null; } if (sm != null) { sm.Close(); sm.Dispose(); sm = null; } }
public void Dispose() { if (_smoother1D != null) { _smoother1D.Dispose(); } if (_smoother2D != null) { _smoother2D.Dispose(); } if (_smoother3D != null) { _smoother3D.Dispose(); } if (_smoother != null) { _smoother.Dispose(); } }