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