Skip to content

Commit 93038e2

Browse files
authored
Dispose loggerFactory in benchmark (#5330)
1 parent 5ac06dd commit 93038e2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/Benchmarks/Logs/LogBenchmarks.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ public LogBenchmarks()
7272
this.loggerWithThreeProcessors = this.loggerFactoryWithThreeProcessor.CreateLogger<LogBenchmarks>();
7373
}
7474

75+
[GlobalCleanup]
76+
public void GlobalCleanup()
77+
{
78+
this.loggerFactoryWithNoListener.Dispose();
79+
this.loggerFactoryWithOneProcessor.Dispose();
80+
this.loggerFactoryWithTwoProcessor.Dispose();
81+
this.loggerFactoryWithThreeProcessor.Dispose();
82+
}
83+
7584
[Benchmark]
7685
public void NoListenerStringInterpolation()
7786
{

0 commit comments

Comments
 (0)