diff --git a/src/tools/wix/Pdb.cs b/src/tools/wix/Pdb.cs index ee3bba3cf..92da3aee3 100644 --- a/src/tools/wix/Pdb.cs +++ b/src/tools/wix/Pdb.cs @@ -84,6 +84,7 @@ public static Pdb Load(string path, bool suppressVersionCheck, bool suppressSche internal static Pdb Load(Stream stream, Uri uri, bool suppressVersionCheck, bool suppressSchema) { XmlReader reader = null; + TempFileCollection tempFileCollection = null; string cabPath = null; // look for the Microsoft cabinet file header and save the cabinet data if found @@ -91,10 +92,8 @@ internal static Pdb Load(Stream stream, Uri uri, bool suppressVersionCheck, bool { long cabFileSize = 0; byte[] offsetBuffer = new byte[4]; - using (TempFileCollection tempFileCollection = new TempFileCollection()) - { - cabPath = tempFileCollection.AddExtension("cab", true); - } + tempFileCollection = new TempFileCollection(); + cabPath = tempFileCollection.AddExtension("cab", false); // skip the header checksum stream.Seek(4, SeekOrigin.Current); @@ -138,16 +137,7 @@ internal static Pdb Load(Stream stream, Uri uri, bool suppressVersionCheck, bool } Pdb pdb = Parse(reader, suppressVersionCheck); - - if (null != cabPath) - { - if (pdb.Output.TempFiles == null) - { - pdb.Output.TempFiles = new TempFileCollection(); - } - - pdb.Output.TempFiles.AddFile(cabPath, false); - } + pdb.Output.TempFiles = tempFileCollection; return pdb; }