mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 20:17:15 +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
|
||||
{
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue