mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 20:58:34 +01:00
make sure disposable assets are only marked once
This commit is contained in:
parent
3f89b47eef
commit
d419b1095e
1 changed files with 1 additions and 1 deletions
|
@ -54,7 +54,7 @@ namespace MLEM.Content {
|
|||
if (!(read is T t))
|
||||
throw new ContentLoadException($"{reader} returned non-{typeof(T)} for asset {assetName}");
|
||||
this.LoadedAssets[assetName] = t;
|
||||
if (t is IDisposable d)
|
||||
if (t is IDisposable d && !this.disposableAssets.Contains(d))
|
||||
this.disposableAssets.Add(d);
|
||||
return t;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue