Ignore all exceptions when disposing an instance of a subsystem implementation (#15511)

This commit is contained in:
Dongbo Wang
2021-06-07 09:59:24 -07:00
committed by GitHub
parent 3a584d486c
commit 4aaed08955
@@ -280,7 +280,14 @@ namespace System.Management.Automation.Subsystem
ISubsystem impl = subsystemInfo.UnregisterImplementation(id);
if (impl is IDisposable disposable)
{
disposable.Dispose();
try
{
disposable.Dispose();
}
catch
{
// It's OK to ignore all exceptions when disposing the object.
}
}
}