void Close() { if (FStarted) { if (FUserGenerator != null) { FUserGenerator.Dispose(); } FUserGenerator = null; FStarted = false; } }
private void CleanUp() { if (FUserGenerator != null) { FUserGenerator.StopGenerating(); FSkeletonCapability.CalibrationComplete -= skeletonCapbility_CalibrationComplete; FPoseDetectionCapability.PoseDetected -= poseDetectionCapability_PoseDetected; FUserGenerator.LostUser -= userGenerator_LostUser; FUserGenerator.NewUser -= userGenerator_NewUser; FUserGenerator.Dispose(); FUserGenerator = null; FJoints = null; } }