Browse Source

fix concurrency issues in config

af/merge-core
Scott Williams 9 years ago
parent
commit
2232b47e1c
  1. 10
      src/ImageSharp/Configuration.cs

10
src/ImageSharp/Configuration.cs

@ -35,14 +35,14 @@ namespace ImageSharp
private readonly ConcurrentDictionary<IImageFormat, IImageDecoder> mimeTypeDecoders = new ConcurrentDictionary<IImageFormat, IImageDecoder>(); private readonly ConcurrentDictionary<IImageFormat, IImageDecoder> mimeTypeDecoders = new ConcurrentDictionary<IImageFormat, IImageDecoder>();
/// <summary> /// <summary>
/// The list of supported <see cref="IImageFormatDetector"/>s. /// The list of supported <see cref="IImageFormat"/>s.
/// </summary> /// </summary>
private readonly List<IImageFormatDetector> imageFormatDetectors = new List<IImageFormatDetector>(); private readonly ConcurrentBag<IImageFormat> imageFormats = new ConcurrentBag<IImageFormat>();
/// <summary> /// <summary>
/// The list of supported <see cref="IImageFormat"/>s. /// The list of supported <see cref="IImageFormatDetector"/>s.
/// </summary> /// </summary>
private readonly HashSet<IImageFormat> imageFormats = new HashSet<IImageFormat>(); private ConcurrentBag<IImageFormatDetector> imageFormatDetectors = new ConcurrentBag<IImageFormatDetector>();
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="Configuration" /> class. /// Initializes a new instance of the <see cref="Configuration" /> class.
@ -181,7 +181,7 @@ namespace ImageSharp
/// </summary> /// </summary>
public void ClearImageFormatDetectors() public void ClearImageFormatDetectors()
{ {
this.imageFormatDetectors.Clear(); this.imageFormatDetectors = new ConcurrentBag<IImageFormatDetector>();
} }
/// <summary> /// <summary>

Loading…
Cancel
Save