mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 18:27:24 +01:00
fix crashing and such
This commit is contained in:
parent
912d0bd800
commit
a37281b719
4 changed files with 16 additions and 21 deletions
|
|
@ -390,7 +390,7 @@ public class CachedPlayer : MediatorSubscriberBase, IDisposable
|
|||
}
|
||||
}
|
||||
|
||||
while (!_applicationTask?.IsCompleted ?? false)
|
||||
while (!_applicationTask?.IsCompleted ?? false && !downloadToken.IsCancellationRequested)
|
||||
{
|
||||
// block until current application is done
|
||||
_logger.LogDebug("Waiting for current data application (Id: {id}) to finish", _applicationId);
|
||||
|
|
@ -416,15 +416,12 @@ public class CachedPlayer : MediatorSubscriberBase, IDisposable
|
|||
_logger.LogDebug("[{applicationId}] Application finished", _applicationId);
|
||||
});
|
||||
|
||||
}, downloadToken).ContinueWith(task =>
|
||||
{
|
||||
_downloadCancellationTokenSource = null;
|
||||
_downloadCancellationTokenSource = null;
|
||||
|
||||
if (!task.IsCanceled) return;
|
||||
_logger.LogDebug("Download was cancelled");
|
||||
_apiController.CancelDownload(downloadId);
|
||||
|
||||
_logger.LogDebug("Download was cancelled");
|
||||
_apiController.CancelDownload(downloadId);
|
||||
});
|
||||
}, downloadToken);
|
||||
}
|
||||
|
||||
private Task? _applicationTask;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue