diff options
| author | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-08-31 04:48:46 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-08-31 04:48:46 +0300 |
| commit | 76a913a9d3e70f4379c3aaca7e6dd8e4da6aff13 (patch) | |
| tree | 5c1faa8986974daed7393c61e2fe67abb87f275b /Software/Visual_Studio/Tango.Telemetry | |
| parent | a1d55aa060450b0a16b597794686b2aa41eea259 (diff) | |
| download | Tango-76a913a9d3e70f4379c3aaca7e6dd8e4da6aff13.tar.gz Tango-76a913a9d3e70f4379c3aaca7e6dd8e4da6aff13.zip | |
Telemetry closed corners.
Diffstat (limited to 'Software/Visual_Studio/Tango.Telemetry')
| -rw-r--r-- | Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs b/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs index 45da1a1ca..eb4ba57f1 100644 --- a/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs +++ b/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisher.cs @@ -191,6 +191,8 @@ namespace Tango.Telemetry /// </summary> private void StreamingSource_TelemetryAvailable(object sender, TelemetryAvailableEventArgs e) { + if (_isDisposed) return; + var source = sender as ITelemetrySource; if (source != null) { @@ -1022,12 +1024,20 @@ namespace Tango.Telemetry _isDisposed = true; foreach (var source in InnerSources) { - if (source is ITelemetryStreamingSource streamingSource) + try + { + if (source is ITelemetryStreamingSource streamingSource) + { + streamingSource.Stop(); + streamingSource.TelemetryAvailable -= StreamingSource_TelemetryAvailable; + } + + source.Dispose(); + } + catch (Exception ex) { - streamingSource.Stop(); - streamingSource.TelemetryAvailable -= StreamingSource_TelemetryAvailable; + LogManager.Log(ex, $"Error disposing telemetry source {source.Name}."); } - source.Dispose(); } if (IsStarted) @@ -1037,7 +1047,14 @@ namespace Tango.Telemetry foreach (var destination in Destinations) { - destination.Dispose(); + try + { + destination.Dispose(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error disposing telemetry destination {destination.Name}."); + } } } } |
