Exit thumbnail generation loop on ThreadAbortException

- Prevent exception suppression
- Name thread for improved debugging experience
This commit is contained in:
John Lewin 2017-06-04 08:25:02 -07:00
parent 9a91ddf219
commit 8870fe3b1d

View file

@ -265,6 +265,8 @@ namespace MatterHackers.MatterControl
private async void ThumbGeneration()
{
Thread.CurrentThread.Name = $"ThumbnailGeneration";
while(true)
{
while(queuedThumbCallbacks.Count > 0)
@ -284,6 +286,10 @@ namespace MatterHackers.MatterControl
{
await callback();
}
catch(ThreadAbortException e)
{
return;
}
catch (Exception ex)
{
Console.WriteLine("Error generating thumbnail: " + ex.Message);