Baseline.DisposableExtensions.SafeDispose C# (CSharp) Method

SafeDispose() public static method

Attempts to call Dispose(), but swallows and discards any exceptions thrown
public static SafeDispose ( this disposable ) : void
disposable this
return void
        public static void SafeDispose(this IDisposable disposable)
        {
            try
            {
                disposable.Dispose();
            }
            catch (Exception)
            {
                // That's right, swallow that exception
            }
        }
DisposableExtensions