diff --git a/DH.Devices.Vision/SimboVisionDriver.cs b/DH.Devices.Vision/SimboVisionDriver.cs index 37efa21..afa5444 100644 --- a/DH.Devices.Vision/SimboVisionDriver.cs +++ b/DH.Devices.Vision/SimboVisionDriver.cs @@ -36,7 +36,20 @@ namespace DH.Devices.Vision // ImageSaveHelper.OnImageSaveExceptionRaised += ImageSaveHelper_OnImageSaveExceptionRaised; // base.Init(); } - + public void Stop() + { + SimboStationMLEngineList.ToList().ForEach(sm => + { + if (sm.IsUseGPU) + { + sm.StationMLEngine.Dispose(); + } + else + { + sm.StationMLEngine.Dispose2(); + } + }); + } //private void ImageSaveHelper_OnImageSaveExceptionRaised(DateTime dt, string msg) //{ // LogAsync(new LogMsg(dt, LogLevel.Error, msg)); diff --git a/DHSoftware/MainWindow.cs b/DHSoftware/MainWindow.cs index fa2fc4d..8754f09 100644 --- a/DHSoftware/MainWindow.cs +++ b/DHSoftware/MainWindow.cs @@ -517,7 +517,7 @@ namespace DHSoftware { PLC.CloseProcess(); } - + _visionEngine.Stop();//释放模型 CloseWindow.Instance.Close();// 关闭提示窗口 //Application.Exit(); System.Environment.Exit(0);