MagFluxToolBox: - Exit corrected

This commit is contained in:
Thomas Wiedebusch
2023-05-08 15:37:53 +02:00
parent 3c36df16a8
commit 916ec78aa4
+7 -3
View File
@@ -94,9 +94,13 @@ namespace Xylem.Common.Ui.MagFluxToolBox
private void FrmTest_FormClosing(Object sender, FormClosingEventArgs e)
{
_magFluxMeter.OnStreamingRecordDecoded -= StreamingCatcher_OnStreamingRecordDecoded;
_magFluxMeter?.Logout();
_magFluxMeter?.StopStreamingCatcher();
if (_magFluxMeter != null)
{
_magFluxMeter.OnStreamingRecordDecoded -= StreamingCatcher_OnStreamingRecordDecoded;
_magFluxMeter.Logout();
_magFluxMeter.StopStreamingCatcher();
}
_meterBatch?.RemoveAllMeters();
_meterBatch?.Dispose();