Mpdreamz / shellprogressbar

ShellProgressBar - display progress in your console application
MIT License
1.43k stars 134 forks source link

Child progress bars stay forever if disposed before Tick is called on them #60

Open jnm2 opened 4 years ago

jnm2 commented 4 years ago

It appears that I have to use this pattern:

using (var conversionProgress = rewriteProgress.Spawn(1, "Converting Windows PDB to portable..."))
{
    try
    {
        // Something that might throw
    }
    finally
    {
        conversionProgress.Tick(); // Otherwise the conversionProgress bar stays foreverup
    }
}
jnm2 commented 4 years ago

I'm less sure now because my workaround above still doesn't seem to work all of the time. There wouldn't be a problem with updating child progress bars from four concurrent tasks, would there?