Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/aspnet/MessagePack-CSharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@live.com>2022-08-02 16:10:46 +0300
committerAndrew Arnott <andrewarnott@live.com>2022-08-02 16:20:12 +0300
commit1092f85b68ceff6667eadf43081097e02adb77c8 (patch)
tree186cf33cf32fdfbd293b84a2c9cc05cab182f6b3
parent8fe5fc94669f9cc1d3feb2bdbc5d5523e54d0e9a (diff)
Fix PerBenchmarkDotNet project
This has evidently been broken since I regressed it in 5c0220eecc34.
-rw-r--r--sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs b/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs
index 8afaccc1..64e7c89a 100644
--- a/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs
+++ b/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs
@@ -13,7 +13,7 @@ namespace PerfBenchmarkDotNet
{
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
[CategoriesColumn]
- public sealed class MessagePackWriterBenchmark : IDisposable
+ public class MessagePackWriterBenchmark : IDisposable
{
private const int RepsOverArray = 300 * 1024;
private readonly Sequence<byte> sequence = new Sequence<byte>();
@@ -152,7 +152,16 @@ namespace PerfBenchmarkDotNet
public void Dispose()
{
- this.sequence.Dispose();
+ this.Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ this.sequence.Dispose();
+ }
}
}
}