mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-02 13:53:40 +01:00
Fix inconsistency
This commit is contained in:
parent
8fa8ca43b6
commit
111029e9bc
1 changed files with 6 additions and 2 deletions
|
|
@ -235,7 +235,7 @@ internal sealed class TextureManager : IServiceType, IDisposable, ITextureProvid
|
||||||
{
|
{
|
||||||
await using var ms = stream.CanSeek ? new MemoryStream((int)stream.Length) : new();
|
await using var ms = stream.CanSeek ? new MemoryStream((int)stream.Length) : new();
|
||||||
await stream.CopyToAsync(ms, ct).ConfigureAwait(false);
|
await stream.CopyToAsync(ms, ct).ConfigureAwait(false);
|
||||||
return await this.CreateFromImageAsync(ms.GetBuffer(), ct);
|
return this.NoThrottleCreateFromImage(ms.GetBuffer());
|
||||||
},
|
},
|
||||||
cancellationToken)
|
cancellationToken)
|
||||||
.ContinueWith(
|
.ContinueWith(
|
||||||
|
|
@ -249,6 +249,10 @@ internal sealed class TextureManager : IServiceType, IDisposable, ITextureProvid
|
||||||
.Unwrap();
|
.Unwrap();
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
// NOTE: if this function is changed to be placed under the effect of the throttler, then look for the usages of
|
||||||
|
// this function, and for the usages that are used as a part of the delegate passed to LoadTextureAsync, change them
|
||||||
|
// to create texture in a non-throttling way; otherwise, recursive throttled texture load call will happen, and it
|
||||||
|
// may deadlock.
|
||||||
public IDalamudTextureWrap CreateFromRaw(
|
public IDalamudTextureWrap CreateFromRaw(
|
||||||
RawImageSpecification specs,
|
RawImageSpecification specs,
|
||||||
ReadOnlySpan<byte> bytes)
|
ReadOnlySpan<byte> bytes)
|
||||||
|
|
@ -317,7 +321,7 @@ internal sealed class TextureManager : IServiceType, IDisposable, ITextureProvid
|
||||||
{
|
{
|
||||||
await using var ms = stream.CanSeek ? new MemoryStream((int)stream.Length) : new();
|
await using var ms = stream.CanSeek ? new MemoryStream((int)stream.Length) : new();
|
||||||
await stream.CopyToAsync(ms, ct).ConfigureAwait(false);
|
await stream.CopyToAsync(ms, ct).ConfigureAwait(false);
|
||||||
return await this.CreateFromRawAsync(specs, ms.GetBuffer(), ct);
|
return this.CreateFromRaw(specs, ms.GetBuffer().AsSpan(0, (int)ms.Length));
|
||||||
},
|
},
|
||||||
cancellationToken)
|
cancellationToken)
|
||||||
.ContinueWith(
|
.ContinueWith(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue