File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
sandbox/PerfBenchmarkDotNet Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ namespace PerfBenchmarkDotNet
1313{
1414 [ GroupBenchmarksBy ( BenchmarkLogicalGroupRule . ByCategory ) ]
1515 [ CategoriesColumn ]
16- public sealed class MessagePackWriterBenchmark : IDisposable
16+ public class MessagePackWriterBenchmark : IDisposable
1717 {
1818 private const int RepsOverArray = 300 * 1024 ;
1919 private readonly Sequence < byte > sequence = new Sequence < byte > ( ) ;
@@ -152,7 +152,16 @@ public void WriteString()
152152
153153 public void Dispose ( )
154154 {
155- this . sequence . Dispose ( ) ;
155+ this . Dispose ( true ) ;
156+ GC . SuppressFinalize ( this ) ;
157+ }
158+
159+ protected virtual void Dispose ( bool disposing )
160+ {
161+ if ( disposing )
162+ {
163+ this . sequence . Dispose ( ) ;
164+ }
156165 }
157166 }
158167}
You can’t perform that action at this time.
0 commit comments