mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-13 20:47:24 +00:00
Potential fix for invalid operation exception
This commit is contained in:
parent
c80fea4db9
commit
05bc50d2a0
1 changed files with 3 additions and 6 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue