mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 20:54:16 +01:00
fix: actually increase refcount if we have multiple handles
This commit is contained in:
parent
d1fad810cf
commit
5cfddb23dd
1 changed files with 6 additions and 8 deletions
|
|
@ -250,20 +250,18 @@ internal class TextureManager : IDisposable, IServiceType, ITextureSubstitutionP
|
|||
|
||||
if (!refresh)
|
||||
return null;
|
||||
|
||||
// NOTE: We need to init the refcount here while locking the collection!
|
||||
// Otherwise, if this is loaded from a task, cleanup might already try to delete it
|
||||
// before it can be increased.
|
||||
info = new TextureInfo
|
||||
{
|
||||
RefCount = 1,
|
||||
};
|
||||
|
||||
info = new TextureInfo();
|
||||
this.activeTextures.Add(path, info);
|
||||
}
|
||||
|
||||
if (info == null)
|
||||
throw new Exception("null info in activeTextures");
|
||||
|
||||
// NOTE: We need to increase the refcount here while locking the collection!
|
||||
// Otherwise, if this is loaded from a task, cleanup might already try to delete it
|
||||
// before it can be increased.
|
||||
info.RefCount++;
|
||||
}
|
||||
|
||||
if (refresh && info.KeepAliveCount == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue