From ec49044cb3918625f706be2ffe12df45627a9f8d Mon Sep 17 00:00:00 2001 From: nico Date: Sun, 14 Jan 2024 14:03:51 +0100 Subject: [PATCH] Trigger the SensorStop method (hopefully) --- KinectConnection/KinectManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/KinectConnection/KinectManager.cs b/KinectConnection/KinectManager.cs index 73e73bd..286e114 100644 --- a/KinectConnection/KinectManager.cs +++ b/KinectConnection/KinectManager.cs @@ -72,6 +72,12 @@ namespace KinectConnection { this.StatusText = this.kinectSensor.IsAvailable ? "Kinect Available" : "Kinect Not Available"; this.Status = this.kinectSensor.IsAvailable; + + // if sensor is unplugged => trigger the stop method + if (!this.kinectSensor.IsAvailable) + { + this.StopSensor(); + } } } }