Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Libraries/Opc.Ua.Server/NodeManager/SamplingGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@
m_shutdownEvent.Set();
m_samplingRates.Clear();
}

if (m_samplingTask != null)
{
try
{
m_samplingTask.Wait();
}
catch (AggregateException) { /* Ignore exceptions on shutdown */ }

Check warning on line 111 in Libraries/Opc.Ua.Server/NodeManager/SamplingGroup.cs

View check run for this annotation

Codecov / codecov/patch

Libraries/Opc.Ua.Server/NodeManager/SamplingGroup.cs#L109-L111

Added lines #L109 - L111 were not covered by tests
}

Utils.SilentDispose(m_samplingTask);
Utils.SilentDispose(m_shutdownEvent);

Check warning on line 115 in Libraries/Opc.Ua.Server/NodeManager/SamplingGroup.cs

View check run for this annotation

Codecov / codecov/patch

Libraries/Opc.Ua.Server/NodeManager/SamplingGroup.cs#L114-L115

Added lines #L114 - L115 were not covered by tests
}
}
#endregion
Expand Down Expand Up @@ -130,9 +142,7 @@
{
m_shutdownEvent.Set();
m_items.Clear();
Utils.SilentDispose(m_samplingTask);
m_samplingTask = null;
Utils.SilentDispose(m_shutdownEvent);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ public virtual void ApplyChanges()
// remove unused groups.
foreach (SamplingGroup samplingGroup in unusedGroups)
{
samplingGroup.Shutdown();
m_samplingGroups.Remove(samplingGroup);
}
}
Expand Down
Loading