diff options
Diffstat (limited to 'src/WixToolset.Core/Linker.cs')
-rw-r--r-- | src/WixToolset.Core/Linker.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/WixToolset.Core/Linker.cs b/src/WixToolset.Core/Linker.cs index a6d43715..320f7d1f 100644 --- a/src/WixToolset.Core/Linker.cs +++ b/src/WixToolset.Core/Linker.cs | |||
@@ -585,13 +585,15 @@ namespace WixToolset.Core | |||
585 | // now and after processing added back in Step 3 below. | 585 | // now and after processing added back in Step 3 below. |
586 | foreach (var section in sections) | 586 | foreach (var section in sections) |
587 | { | 587 | { |
588 | var removeSymbols = new List<IntermediateSymbol>(); | ||
589 | |||
588 | // Count down because we'll sometimes remove items from the list. | 590 | // Count down because we'll sometimes remove items from the list. |
589 | for (var i = section.Symbols.Count - 1; i >= 0; --i) | 591 | foreach (var symbol in section.Symbols) |
590 | { | 592 | { |
591 | // Only process the "grouping parents" such as FeatureGroup, ComponentGroup, Feature, | 593 | // Only process the "grouping parents" such as FeatureGroup, ComponentGroup, Feature, |
592 | // and Module. Non-grouping complex references are simple and | 594 | // and Module. Non-grouping complex references are simple and |
593 | // resolved during normal complex reference resolutions. | 595 | // resolved during normal complex reference resolutions. |
594 | if (section.Symbols[i] is WixComplexReferenceSymbol wixComplexReferenceRow && | 596 | if (symbol is WixComplexReferenceSymbol wixComplexReferenceRow && |
595 | (ComplexReferenceParentType.FeatureGroup == wixComplexReferenceRow.ParentType || | 597 | (ComplexReferenceParentType.FeatureGroup == wixComplexReferenceRow.ParentType || |
596 | ComplexReferenceParentType.ComponentGroup == wixComplexReferenceRow.ParentType || | 598 | ComplexReferenceParentType.ComponentGroup == wixComplexReferenceRow.ParentType || |
597 | ComplexReferenceParentType.Feature == wixComplexReferenceRow.ParentType || | 599 | ComplexReferenceParentType.Feature == wixComplexReferenceRow.ParentType || |
@@ -611,7 +613,7 @@ namespace WixToolset.Core | |||
611 | } | 613 | } |
612 | 614 | ||
613 | childrenComplexRefs.Add(wixComplexReferenceRow); | 615 | childrenComplexRefs.Add(wixComplexReferenceRow); |
614 | section.Symbols.RemoveAt(i); | 616 | removeSymbols.Add(wixComplexReferenceRow); |
615 | 617 | ||
616 | // Remember the mapping from set of complex references with a common | 618 | // Remember the mapping from set of complex references with a common |
617 | // parent to their section. We'll need this to add them back to the | 619 | // parent to their section. We'll need this to add them back to the |
@@ -635,6 +637,11 @@ namespace WixToolset.Core | |||
635 | } | 637 | } |
636 | } | 638 | } |
637 | } | 639 | } |
640 | |||
641 | foreach (var removeSymbol in removeSymbols) | ||
642 | { | ||
643 | section.RemoveSymbol(removeSymbol); | ||
644 | } | ||
638 | } | 645 | } |
639 | 646 | ||
640 | Debug.Assert(parentGroups.Count == parentGroupsSections.Count); | 647 | Debug.Assert(parentGroups.Count == parentGroupsSections.Count); |