diff --git a/Dalamud/Interface/Internal/StaThreadService.cs b/Dalamud/Interface/Internal/StaThreadService.cs index bb5caa281..5e93bbf75 100644 --- a/Dalamud/Interface/Internal/StaThreadService.cs +++ b/Dalamud/Interface/Internal/StaThreadService.cs @@ -113,7 +113,7 @@ internal partial class StaThreadService : IInternalDisposableService using var cts = CancellationTokenSource.CreateLinkedTokenSource( this.cancellationTokenSource.Token, cancellationToken); - await this.taskFactory.StartNew(action, cancellationToken).ConfigureAwait(true); + await this.taskFactory.StartNew(action, cts.Token).ConfigureAwait(true); } /// Runs a given delegate in the messaging thread. @@ -126,7 +126,7 @@ internal partial class StaThreadService : IInternalDisposableService using var cts = CancellationTokenSource.CreateLinkedTokenSource( this.cancellationTokenSource.Token, cancellationToken); - return await this.taskFactory.StartNew(func, cancellationToken).ConfigureAwait(true); + return await this.taskFactory.StartNew(func, cts.Token).ConfigureAwait(true); } /// Runs a given delegate in the messaging thread. @@ -138,7 +138,7 @@ internal partial class StaThreadService : IInternalDisposableService using var cts = CancellationTokenSource.CreateLinkedTokenSource( this.cancellationTokenSource.Token, cancellationToken); - await await this.taskFactory.StartNew(func, cancellationToken).ConfigureAwait(true); + await await this.taskFactory.StartNew(func, cts.Token).ConfigureAwait(true); } /// Runs a given delegate in the messaging thread. @@ -151,7 +151,7 @@ internal partial class StaThreadService : IInternalDisposableService using var cts = CancellationTokenSource.CreateLinkedTokenSource( this.cancellationTokenSource.Token, cancellationToken); - return await await this.taskFactory.StartNew(func, cancellationToken).ConfigureAwait(true); + return await await this.taskFactory.StartNew(func, cts.Token).ConfigureAwait(true); } [LibraryImport("ole32.dll")]