From 2ec917d665d283326ba4eb35e5bcd24dfc8b8643 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Wed, 30 Aug 2023 17:57:52 +0200 Subject: [PATCH] Dispose of the PathCache. --- src/Skia/Avalonia.Skia/GeometryImpl.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Skia/Avalonia.Skia/GeometryImpl.cs b/src/Skia/Avalonia.Skia/GeometryImpl.cs index 0cee36204d..4f2e8f30d8 100644 --- a/src/Skia/Avalonia.Skia/GeometryImpl.cs +++ b/src/Skia/Avalonia.Skia/GeometryImpl.cs @@ -78,7 +78,7 @@ namespace Avalonia.Skia public IGeometryImpl GetWidenedGeometry(IPen pen) { - var cache = new PathCache(); + using var cache = new PathCache(); cache.UpdateIfNeeded(StrokePath, pen); if (cache.ExpandedPath is { } path) @@ -160,7 +160,7 @@ namespace Avalonia.Skia _pathCache = default; } - private struct PathCache + private struct PathCache : IDisposable { private double _width, _miterLimit; private PenLineCap _cap;