using System;
using System.Collections.Generic;

namespace MsgPack.Rpc
{
	internal static class DisposableExtensions
	{
		public static void DisposeAll( this IEnumerable<IDisposable> source )
		{
			if ( source == null )
			{
				return;
			}

			foreach ( var target in source )
			{
				if ( target != null )
				{
					try
					{
						target.Dispose();
					}
					catch { }
				}
			}
		}
	}
}
