try catch on long running task
don't crash subtract cancel
This commit is contained in:
parent
8b49a3e898
commit
d2b5bd0a44
2 changed files with 12 additions and 1 deletions
|
|
@ -1453,7 +1453,14 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
return Task.Run(async () =>
|
||||
{
|
||||
await func?.Invoke(taskDetails, tokenSource.Token);
|
||||
try
|
||||
{
|
||||
await func?.Invoke(taskDetails, tokenSource.Token);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
executingTasks.Remove(taskDetails);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -192,6 +192,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D
|
|||
progressStatus.Progress0To1 = percentCompleted + amountPerOperation * csgStatus.Progress0To1;
|
||||
reporter.Report(progressStatus);
|
||||
}, cancelationToken);
|
||||
if(cancelationToken.IsCancellationRequested)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
var inverse = keep.WorldMatrix();
|
||||
inverse.Invert();
|
||||
transformedKeep.Transform(inverse);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue