Skip to content

Commit 1092f85

Browse files
committed
Fix PerBenchmarkDotNet project
This has evidently been broken since I regressed it in 5c0220e.
1 parent 8fe5fc9 commit 1092f85

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)