Skip to content

Commit

Permalink
[Graphics] - Fixed a bug in texture cache where calling Clear after d…
Browse files Browse the repository at this point in the history
…isposing throw an exception.
  • Loading branch information
Tape-Worm committed Mar 17, 2022
1 parent ccc2354 commit 4f94779
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Gorgon/Gorgon.Graphics.Core/Textures/GorgonTextureCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,11 @@ public int GetUserCount(T texture)
/// </remarks>
public void Clear()
{
if ((_cache is null) || (_cache.Values.Count == 0) || (_cacheLock is null))
{
return;
}

try
{
_cacheLock.Wait();
Expand Down

0 comments on commit 4f94779

Please sign in to comment.