From 70907ee5547cef317e7d6db82a54fce1ed39f998 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 31 Jan 2022 17:34:22 +0000 Subject: rescribe: remove unnecessary extra cancel calls; anything which errors should clean up well enough, and this has the potential for more harder to find bugs --- cmd/rescribe/gui.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cmd/rescribe/gui.go b/cmd/rescribe/gui.go index d5a132f..8bbb3f5 100644 --- a/cmd/rescribe/gui.go +++ b/cmd/rescribe/gui.go @@ -386,8 +386,6 @@ func startGui(log log.Logger, cmd string, training string, tessdir string) error fmt.Fprintf(os.Stderr, msg) } - cancel() - ctx, cancel = context.WithCancel(context.Background()) progressBar.SetValue(0.0) for _, v := range []fyne.Disableable{folderBtn, pdfBtn, gbookBtn, trainingOpts, gobtn} { v.Enable() @@ -403,8 +401,6 @@ func startGui(log log.Logger, cmd string, training string, tessdir string) error dialog.ShowError(errors.New(msg), myWindow) fmt.Fprintf(os.Stderr, msg) - cancel() - ctx, cancel = context.WithCancel(context.Background()) progressBar.SetValue(0.0) for _, v := range []fyne.Disableable{folderBtn, pdfBtn, gbookBtn, trainingOpts, gobtn} { v.Enable() @@ -430,8 +426,6 @@ func startGui(log log.Logger, cmd string, training string, tessdir string) error return } if err != nil { - cancel() - ctx, cancel = context.WithCancel(context.Background()) msg := fmt.Sprintf("Error during processing: %v\n", err) dialog.ShowError(errors.New(msg), myWindow) fmt.Fprintf(os.Stderr, msg) -- cgit v1.2.1-24-ge1ad