Browse Source

Update tests/Avalonia.Base.UnitTests/Media/FontManagerTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pull/21269/head
Benedikt Stebner 5 months ago
committed by GitHub
parent
commit
8b21872430
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      tests/Avalonia.Base.UnitTests/Media/FontManagerTests.cs

3
tests/Avalonia.Base.UnitTests/Media/FontManagerTests.cs

@ -117,7 +117,8 @@ namespace Avalonia.Base.UnitTests.Media
for (int i = 0; i < iterations; i++)
{
// Remove the cached collection so both threads must re-create it.
fontCollections.TryRemove(collectionKey, out _);
if (fontCollections.TryRemove(collectionKey, out var removedCollection))
removedCollection.Dispose();
using var barrier = new Barrier(2);
bool r1 = false, r2 = false;

Loading…
Cancel
Save