Browse Source

Dispose CecilTypeSystem in XAML compiler task (#13429)

pull/13431/head
Nikita Tsukanov 2 years ago
committed by GitHub
parent
commit
2a85f7cafe
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs

4
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;

Loading…
Cancel
Save