mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-10 18:24:53 +00:00
Potential fix for invalid operation exception
This commit is contained in:
@@ -34,12 +34,9 @@ namespace ICD.Common.Services
|
||||
try
|
||||
{
|
||||
m_ServicesSection.Enter();
|
||||
foreach (object service in m_Services.Values.Distinct())
|
||||
{
|
||||
if (!(service is IDisposable))
|
||||
continue;
|
||||
((IDisposable)service).Dispose();
|
||||
}
|
||||
|
||||
foreach (IDisposable service in m_Services.Values.OfType<IDisposable>().Distinct().ToArray())
|
||||
service.Dispose();
|
||||
m_Services.Clear();
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user