From a15eae6833b934f2470d1af1c78fec896a19dc72 Mon Sep 17 00:00:00 2001 From: Vadym Artemchuk Date: Tue, 22 Jul 2025 11:37:08 +0300 Subject: [PATCH] explicit dispose skia objects (#19100) --- src/Skia/Avalonia.Skia/Gpu/OpenGl/FboSkiaSurface.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Skia/Avalonia.Skia/Gpu/OpenGl/FboSkiaSurface.cs b/src/Skia/Avalonia.Skia/Gpu/OpenGl/FboSkiaSurface.cs index 4a3031d9ad..d9027e24d7 100644 --- a/src/Skia/Avalonia.Skia/Gpu/OpenGl/FboSkiaSurface.cs +++ b/src/Skia/Avalonia.Skia/Gpu/OpenGl/FboSkiaSurface.cs @@ -89,10 +89,10 @@ namespace Avalonia.Skia throw new OpenGlException("Unable to create FBO with stencil"); } - var target = new GRBackendRenderTarget(pixelSize.Width, pixelSize.Height, 0, 8, + using var target = new GRBackendRenderTarget(pixelSize.Width, pixelSize.Height, 0, 8, new GRGlFramebufferInfo((uint)_fbo, SKColorType.Rgba8888.ToGlSizedFormat())); - _surface = SKSurface.Create(_grContext, target, - surfaceOrigin, SKColorType.Rgba8888, new SKSurfaceProperties(SKPixelGeometry.RgbHorizontal)); + using var properties = new SKSurfaceProperties(SKPixelGeometry.RgbHorizontal); + _surface = SKSurface.Create(_grContext, target, surfaceOrigin, SKColorType.Rgba8888, properties); CanBlit = gl.IsBlitFramebufferAvailable; }