From add525424e44a050d3f98f64e56a85ab5d79955d Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 13 Feb 2020 14:28:58 -0500 Subject: Make BindResult disposable to manage WixOutput disposability. --- src/WixToolset.Core.WindowsInstaller/MspBackend.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller/MspBackend.cs') diff --git a/src/WixToolset.Core.WindowsInstaller/MspBackend.cs b/src/WixToolset.Core.WindowsInstaller/MspBackend.cs index 8aa450bf..5dc64445 100644 --- a/src/WixToolset.Core.WindowsInstaller/MspBackend.cs +++ b/src/WixToolset.Core.WindowsInstaller/MspBackend.cs @@ -47,21 +47,24 @@ namespace WixToolset.Core.WindowsInstaller // Create WindowsInstallerData with patch metdata and transforms as sub-storages // Create MSP from WindowsInstallerData - using (var command = new BindDatabaseCommand(context, backendExtensions, subStorages, null)) + IBindResult result = null; + try { - command.Execute(); - - var result = context.ServiceProvider.GetService(); - result.FileTransfers = command.FileTransfers; - result.TrackedFiles = command.TrackedFiles; + var command = new BindDatabaseCommand(context, backendExtensions, subStorages, null); + result = command.Execute(); foreach (var extension in backendExtensions) { - extension.PostBackendBind(result, command.Wixout); + extension.PostBackendBind(result); } return result; } + catch + { + result?.Dispose(); + throw; + } } public IDecompileResult Decompile(IDecompileContext context) => throw new NotImplementedException(); -- cgit v1.2.3-55-g6feb