From 8d395d88ad15ac02beb30bbaceb223c45463a970 Mon Sep 17 00:00:00 2001 From: chinaboard Date: Wed, 13 Jan 2016 12:09:41 +0800 Subject: [PATCH] fix [#123](https://github.com/etishor/Metrics.NET/issues/123) release memory after completelyDisableMetrics --- Src/Metrics/Core/HistogramMetric.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Src/Metrics/Core/HistogramMetric.cs b/Src/Metrics/Core/HistogramMetric.cs index a5d25a2c..3c434aa2 100644 --- a/Src/Metrics/Core/HistogramMetric.cs +++ b/Src/Metrics/Core/HistogramMetric.cs @@ -6,7 +6,7 @@ namespace Metrics.Core { public interface HistogramImplementation : Histogram, MetricValueProvider { } - public sealed class HistogramMetric : HistogramImplementation + public sealed class HistogramMetric : HistogramImplementation, IDisposable { private readonly Reservoir reservoir; private UserValueWrapper last = new UserValueWrapper(); @@ -62,5 +62,13 @@ private static Reservoir SamplingTypeToReservoir(SamplingType samplingType) } throw new InvalidOperationException("Sampling type not implemented " + samplingType.ToString()); } + + public void Dispose() + { + using (reservoir as IDisposable) + { + + } + } } }