diff options
| author | Bob Arnson <bob@firegiant.com> | 2020-02-13 14:28:58 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2020-02-13 15:07:43 -0500 |
| commit | add525424e44a050d3f98f64e56a85ab5d79955d (patch) | |
| tree | ad02f4f8afe6dfb84db1fc10627058fc1ffe61fc /src/WixToolset.Core.WindowsInstaller/MsmBackend.cs | |
| parent | 7116076d1af5af5f9da51a263a3b8b6a4a2e4ab8 (diff) | |
| download | wix-add525424e44a050d3f98f64e56a85ab5d79955d.tar.gz wix-add525424e44a050d3f98f64e56a85ab5d79955d.tar.bz2 wix-add525424e44a050d3f98f64e56a85ab5d79955d.zip | |
Make BindResult disposable to manage WixOutput disposability.
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/MsmBackend.cs')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/MsmBackend.cs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/MsmBackend.cs b/src/WixToolset.Core.WindowsInstaller/MsmBackend.cs index f048b4e2..4860bf81 100644 --- a/src/WixToolset.Core.WindowsInstaller/MsmBackend.cs +++ b/src/WixToolset.Core.WindowsInstaller/MsmBackend.cs | |||
| @@ -24,21 +24,24 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 24 | 24 | ||
| 25 | var validator = Validator.CreateFromContext(context, "mergemod.cub"); | 25 | var validator = Validator.CreateFromContext(context, "mergemod.cub"); |
| 26 | 26 | ||
| 27 | using (var command = new BindDatabaseCommand(context, backendExtensions, validator)) | 27 | IBindResult result = null; |
| 28 | try | ||
| 28 | { | 29 | { |
| 29 | command.Execute(); | 30 | var command = new BindDatabaseCommand(context, backendExtensions, validator); |
| 30 | 31 | result = command.Execute(); | |
| 31 | var result = context.ServiceProvider.GetService<IBindResult>(); | ||
| 32 | result.FileTransfers = command.FileTransfers; | ||
| 33 | result.TrackedFiles = command.TrackedFiles; | ||
| 34 | 32 | ||
| 35 | foreach (var extension in backendExtensions) | 33 | foreach (var extension in backendExtensions) |
| 36 | { | 34 | { |
| 37 | extension.PostBackendBind(result, command.Wixout); | 35 | extension.PostBackendBind(result); |
| 38 | } | 36 | } |
| 39 | 37 | ||
| 40 | return result; | 38 | return result; |
| 41 | } | 39 | } |
| 40 | catch | ||
| 41 | { | ||
| 42 | result?.Dispose(); | ||
| 43 | throw; | ||
| 44 | } | ||
| 42 | } | 45 | } |
| 43 | 46 | ||
| 44 | public IDecompileResult Decompile(IDecompileContext context) | 47 | public IDecompileResult Decompile(IDecompileContext context) |
