private static void DisposeSource(Stream source)
{
try
{
source.Dispose();
}
catch (Exception e)
{
// Dispose() should never throw, but since we're on an async codepath, make sure to catch the exception.
if (NetEventSource.IsEnabled) NetEventSource.Error(null, e);
}
}
}