From 2a85f7cafed6c90d4a8cd11dee36a9dd15ebcc1e 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 437f509312..3f68092b56 100644 --- a/src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs +++ b/src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs @@ -63,8 +63,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;