Suppress DAssetM dispose exceptions (#1707)

Whether an asset being unavailable should be an error is decided on
Dalamud startup time. This suppresses assets unavailable exceptions on
Dispose.
This commit is contained in:
srkizer 2024-03-14 07:36:43 +09:00 committed by GitHub
parent 7ee20272de
commit 666feede4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,7 +75,7 @@ internal sealed class DalamudAssetManager : IServiceType, IDisposable, IDalamudA
.Where(x => x is not DalamudAsset.Empty4X4) .Where(x => x is not DalamudAsset.Empty4X4)
.Where(x => x.GetAttribute<DalamudAssetAttribute>()?.Required is false) .Where(x => x.GetAttribute<DalamudAssetAttribute>()?.Required is false)
.Select(this.CreateStreamAsync) .Select(this.CreateStreamAsync)
.Select(x => x.ToContentDisposedTask())) .Select(x => x.ToContentDisposedTask(true)))
.ContinueWith(r => Log.Verbose($"Optional assets load state: {r}")); .ContinueWith(r => Log.Verbose($"Optional assets load state: {r}"));
} }
@ -99,6 +99,7 @@ internal sealed class DalamudAssetManager : IServiceType, IDisposable, IDalamudA
.Concat(this.fileStreams.Values) .Concat(this.fileStreams.Values)
.Concat(this.textureWraps.Values) .Concat(this.textureWraps.Values)
.Where(x => x is not null) .Where(x => x is not null)
.Select(x => x.ContinueWith(r => { _ = r.Exception; }))
.ToArray()); .ToArray());
this.scopedFinalizer.Dispose(); this.scopedFinalizer.Dispose();
} }