Browse Source

[Text] do not use linq on dispose

pull/9954/head
Sergey Mikolaitis 4 years ago
parent
commit
91fd89017e
  1. 7
      src/Avalonia.Base/Media/TextFormatting/TextLineImpl.cs

7
src/Avalonia.Base/Media/TextFormatting/TextLineImpl.cs

@ -981,9 +981,12 @@ namespace Avalonia.Media.TextFormatting
public override void Dispose()
{
foreach (var run in _textRuns.OfType<ShapedTextRun>())
for (int i = 0; i < _textRuns.Count; i++)
{
run.Dispose();
if (_textRuns[i] is ShapedTextRun shapedTextRun)
{
shapedTextRun.Dispose();
}
}
}

Loading…
Cancel
Save