Fix multiple cases of using objects which may be disposed

This commit is contained in:
Dean Herbert
2023-11-17 15:11:03 +09:00
parent 852fb723bc
commit a41fc78cf0
3 changed files with 24 additions and 9 deletions

View File

@@ -41,16 +41,22 @@ namespace osu.Framework.Benchmarks
[Benchmark]
public void BenchmarkRawCachingReuse()
{
using (var store = new RawCachingGlyphStore(baseResources, font_name) { CacheStorage = sharedTemp })
using (var store = new RawCachingGlyphStore(baseResources, font_name))
{
store.CacheStorage = sharedTemp;
runFor(store);
}
}
[Benchmark(Baseline = true)]
public void BenchmarkRawCaching()
{
using (var temp = new TemporaryNativeStorage("fontstore-test" + Guid.NewGuid()))
using (var store = new RawCachingGlyphStore(baseResources, font_name) { CacheStorage = temp })
using (var store = new RawCachingGlyphStore(baseResources, font_name))
{
store.CacheStorage = temp;
runFor(store);
}
}
[Benchmark]