mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 10:40:29 +01:00
20 lines
496 B
C#
20 lines
496 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BTCPayServer
|
|
{
|
|
public class CompositeDisposable : IDisposable
|
|
{
|
|
List<IDisposable> _Disposables = new List<IDisposable>();
|
|
public void Add(IDisposable disposable) { _Disposables.Add(disposable); }
|
|
public void Dispose()
|
|
{
|
|
foreach (var d in _Disposables)
|
|
d.Dispose();
|
|
_Disposables.Clear();
|
|
}
|
|
}
|
|
}
|