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

Loading…
Cancel
Save