Hopeful fix for #373

pull/375/head
David Hall 2023-01-28 20:19:00 -07:00
parent e0685fdf46
commit 716b9e4036
1 changed files with 2 additions and 9 deletions

View File

@ -131,15 +131,8 @@ namespace Vanara.InteropServices
/// <remarks>This method is not a member in IStream.</remarks> /// <remarks>This method is not a member in IStream.</remarks>
public override void Close() public override void Close()
{ {
if (netStream is not null) netStream?.Close();
{ try { comStream?.Commit(0 /*STGC_DEFAULT*/); } catch { }
netStream.Close();
}
else
{
comStream.Commit(0 /*STGC_DEFAULT*/);
// Marshal.ReleaseComObject(TheIStream); // Investigate this because we cannot release an IStream to the stash file
}
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }