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/MsiBackend.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/MsiBackend.cs')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/MsiBackend.cs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/MsiBackend.cs b/src/WixToolset.Core.WindowsInstaller/MsiBackend.cs index 86c0fbfe..778720b9 100644 --- a/src/WixToolset.Core.WindowsInstaller/MsiBackend.cs +++ b/src/WixToolset.Core.WindowsInstaller/MsiBackend.cs | |||
| @@ -25,22 +25,24 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 25 | 25 | ||
| 26 | var validator = Validator.CreateFromContext(context, "darice.cub"); | 26 | var validator = Validator.CreateFromContext(context, "darice.cub"); |
| 27 | 27 | ||
| 28 | using (var command = new BindDatabaseCommand(context, backendExtensions, validator)) | 28 | IBindResult result = null; |
| 29 | try | ||
| 29 | { | 30 | { |
| 30 | command.Execute(); | 31 | var command = new BindDatabaseCommand(context, backendExtensions, validator); |
| 31 | 32 | result = command.Execute(); | |
| 32 | var result = context.ServiceProvider.GetService<IBindResult>(); | ||
| 33 | result.FileTransfers = command.FileTransfers; | ||
| 34 | result.TrackedFiles = command.TrackedFiles; | ||
| 35 | result.Wixout = command.Wixout; | ||
| 36 | 33 | ||
| 37 | foreach (var extension in backendExtensions) | 34 | foreach (var extension in backendExtensions) |
| 38 | { | 35 | { |
| 39 | extension.PostBackendBind(result, command.Wixout); | 36 | extension.PostBackendBind(result); |
| 40 | } | 37 | } |
| 41 | 38 | ||
| 42 | return result; | 39 | return result; |
| 43 | } | 40 | } |
| 41 | catch | ||
| 42 | { | ||
| 43 | result?.Dispose(); | ||
| 44 | throw; | ||
| 45 | } | ||
| 44 | } | 46 | } |
| 45 | 47 | ||
| 46 | public IDecompileResult Decompile(IDecompileContext context) | 48 | public IDecompileResult Decompile(IDecompileContext context) |
