Skip to content

Commit

Permalink
Fix the generate button not working the second time
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaily committed Apr 22, 2018
1 parent b1d6911 commit 4706527
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions MovieBarCodeGenerator/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private async void generateButton_Click(object sender, EventArgs e)
if (_cancellationTokenSource != null)
{
_cancellationTokenSource.Cancel();
_cancellationTokenSource.Dispose();
_cancellationTokenSource = null;
generateButton.Text = GenerateButtonText;
progressBar1.Value = progressBar1.Minimum;
Expand Down Expand Up @@ -156,6 +157,8 @@ Here is all the info available at the time of the error (press Ctrl+C to copy it
finally
{
generateButton.Text = GenerateButtonText;
_cancellationTokenSource.Dispose();
_cancellationTokenSource = null;
}

// Save the barcode:
Expand Down

0 comments on commit 4706527

Please sign in to comment.