diff --git a/Implab/Safe.cs b/Implab/Safe.cs --- a/Implab/Safe.cs +++ b/Implab/Safe.cs @@ -36,11 +36,11 @@ namespace Implab throw new ArgumentOutOfRangeException(paramName); } - public static void Dispose(T obj) where T : class + public static void Dispose(params IDisposable[] objects) { - var disp = obj as IDisposable; - if (disp != null) - disp.Dispose(); + foreach(var d in objects) + if (d != null) + d.Dispose(); } [DebuggerStepThrough]