From a733cf8b2d53a0af0b9dde75767fc655e5d6f1d9 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Mon, 30 Oct 2023 10:18:06 +0300 Subject: [PATCH] Dispose CecilTypeSystem in XAML compiler task (#13429) --- src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs b/src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs index 80876f1819..4350c16d99 100644 --- a/src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs +++ b/src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs @@ -59,8 +59,8 @@ namespace Avalonia.Build.Tasks try { references = references.Where(r => !r.ToLowerInvariant().EndsWith("avalonia.build.tasks.dll")).ToArray(); - var typeSystem = new CecilTypeSystem(references, input); - var refTypeSystem = !string.IsNullOrWhiteSpace(refInput) && File.Exists(refInput) ? new CecilTypeSystem(references, refInput) : null; + using var typeSystem = new CecilTypeSystem(references, input); + using var refTypeSystem = !string.IsNullOrWhiteSpace(refInput) && File.Exists(refInput) ? new CecilTypeSystem(references, refInput) : null; var asm = typeSystem.TargetAssemblyDefinition; var refAsm = refTypeSystem?.TargetAssemblyDefinition;