Make dispose
in TranscriptionOption
idempotent (#13839)
Co-authored-by: Krishna Yalavarthi <kryalava@microsoft.com>
This commit is contained in:
parent
d20e1217ad
commit
c8feddb214
|
@ -1173,8 +1173,20 @@ namespace System.Management.Automation.Host
|
|||
|
||||
if (_contentWriter != null)
|
||||
{
|
||||
_contentWriter.Flush();
|
||||
_contentWriter.Dispose();
|
||||
try
|
||||
{
|
||||
_contentWriter.Flush();
|
||||
_contentWriter.Dispose();
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
_contentWriter = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue