From ea4bcdb81575585f87b853123922103e1875a0f4 Mon Sep 17 00:00:00 2001 From: gavazquez Date: Sat, 28 Mar 2020 15:31:54 +0100 Subject: [PATCH] Wait for stop on exit --- GazeTrackerCore/Lister/CameraLister.cs | 2 +- GazeTrackerCore/Producer/DirectShowFrameProducer.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/GazeTrackerCore/Lister/CameraLister.cs b/GazeTrackerCore/Lister/CameraLister.cs index 980448a..84a039c 100644 --- a/GazeTrackerCore/Lister/CameraLister.cs +++ b/GazeTrackerCore/Lister/CameraLister.cs @@ -35,7 +35,7 @@ public static IEnumerable GetAvailableCameras() videoSource.SignalToStop(); videoSource.WaitForStop(); - var camera = new Camera(device.MonikerString, device.Name, resolutions, new RawImage(bitmap), CameraType.Ps3Eye); + var camera = new Camera(device.MonikerString, device.Name, resolutions, new RawImage(new Bitmap(bitmap)), CameraType.Ps3Eye); bitmap = null; yield return camera; diff --git a/GazeTrackerCore/Producer/DirectShowFrameProducer.cs b/GazeTrackerCore/Producer/DirectShowFrameProducer.cs index 87947a2..e909e31 100644 --- a/GazeTrackerCore/Producer/DirectShowFrameProducer.cs +++ b/GazeTrackerCore/Producer/DirectShowFrameProducer.cs @@ -37,6 +37,7 @@ public override void Dispose() { base.Dispose(); _videoSource.SignalToStop(); + _videoSource.WaitForStop(); } public override void ReadFrames(BroadcastBlock broadcast)