mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Ignore all exceptions when disposing an instance of a subsystem implementation (#15511)
This commit is contained in:
@@ -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.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user