diff --git a/Src/Common/Controls/DetailControls/DataTree.cs b/Src/Common/Controls/DetailControls/DataTree.cs
index f05bd108c1..9303b46973 100644
--- a/Src/Common/Controls/DetailControls/DataTree.cs
+++ b/Src/Common/Controls/DetailControls/DataTree.cs
@@ -553,8 +553,11 @@ public void PropChanged(int hvo, int tag, int ivMin, int cvIns, int cvDel)
// return;
if (m_monitoredProps.Contains(Tuple.Create(hvo, tag)))
{
- RefreshList(false);
- OnFocusFirstPossibleSlice(null);
+ // If we call RefreshList now, it causes a crash in the invoker
+ // because some slice data structures that are being used by the invoker
+ // get disposed by RefreshList (LT-21980, LT-22011). So we postpone calling
+ // RefreshList until the work is done.
+ this.BeginInvoke(new Action(PostponedRefreshList));
}
// Note, in LinguaLinks import we don't have an action handler when we hit this.
else if (m_cache.DomainDataByFlid.GetActionHandler() != null && m_cache.DomainDataByFlid.GetActionHandler().IsUndoOrRedoInProgress)
@@ -581,6 +584,15 @@ public void PropChanged(int hvo, int tag, int ivMin, int cvIns, int cvDel)
}
}
+ private void PostponedRefreshList()
+ {
+ if (!IsDisposed)
+ {
+ RefreshList(false);
+ OnFocusFirstPossibleSlice(null);
+ }
+ }
+
///