fix: ITextureProvider thread-safety

This commit is contained in:
goat 2023-08-05 21:36:40 +02:00
parent 2bdc4445d4
commit b96ef30c20
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -1,4 +1,4 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@ -485,17 +485,17 @@ internal class TextureManager : IDisposable, IServiceType, ITextureSubstitutionP
#pragma warning disable SA1015
[ResolveVia<ITextureProvider>]
#pragma warning restore SA1015
internal class TextureManagerPluginScoped : ITextureProvider, IServiceType, IDisposable
internal class TextureProviderPluginScoped : ITextureProvider, IServiceType, IDisposable
{
private readonly TextureManager textureManager;
private readonly List<TextureManagerTextureWrap> trackedTextures = new();
private readonly ConcurrentBag<TextureManagerTextureWrap> trackedTextures = new();
/// <summary>
/// Initializes a new instance of the <see cref="TextureManagerPluginScoped"/> class.
/// Initializes a new instance of the <see cref="TextureProviderPluginScoped"/> class.
/// </summary>
/// <param name="textureManager">TextureManager instance.</param>
public TextureManagerPluginScoped(TextureManager textureManager)
public TextureProviderPluginScoped(TextureManager textureManager)
{
this.textureManager = textureManager;
}