We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fe5fc9 commit 1092f85Copy full SHA for 1092f85
sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs
@@ -13,7 +13,7 @@ namespace PerfBenchmarkDotNet
13
{
14
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
15
[CategoriesColumn]
16
- public sealed class MessagePackWriterBenchmark : IDisposable
+ public class MessagePackWriterBenchmark : IDisposable
17
18
private const int RepsOverArray = 300 * 1024;
19
private readonly Sequence<byte> sequence = new Sequence<byte>();
@@ -152,7 +152,16 @@ public void WriteString()
152
153
public void Dispose()
154
155
- this.sequence.Dispose();
+ 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
165
}
166
167
0 commit comments