Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/SIL.LCModel/DomainImpl/OverridesLing_Lex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7644,15 +7644,23 @@ protected override void RemoveObjectSideEffectsInternal(RemoveObjectEventArgs e)
if (removedCtxt != null)
{
var featConstrs = GetFeatureConstraintsExcept(removedCtxt);
foreach (var constr in removedCtxt.PlusConstrRS)
foreach (var constr in removedCtxt.PlusConstrRS.ToList())
{
if (!featConstrs.Contains(constr))
{
// Remove constr from removedCtxt first to avoid deleting removedCtxt twice (fixes LT-21729).
removedCtxt.PlusConstrRS.Remove(constr);
m_cache.LanguageProject.PhonologicalDataOA.FeatConstraintsOS.Remove(constr);
}
}
foreach (var constr in removedCtxt.MinusConstrRS)
foreach (var constr in removedCtxt.MinusConstrRS.ToList())
{
if (!featConstrs.Contains(constr))
{
// Remove constr from removedCtxt first to avoid deleting removedCtxt twice.
removedCtxt.MinusConstrRS.Remove(constr);
m_cache.LanguageProject.PhonologicalDataOA.FeatConstraintsOS.Remove(constr);
}
}
}
}
Expand Down
Loading