Skip to content

Commit 399c016

Browse files
committed
finalizer
1 parent 333694a commit 399c016

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/pluginmanager/manager.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"os"
1212
"os/exec"
1313
"path/filepath"
14+
"runtime"
1415
"strings"
1516

1617
"github.com/Masterminds/semver"
@@ -64,6 +65,11 @@ var spinner component.OutputWriterSpinner
6465
func init() {
6566
// Initialize global spinner
6667
spinner = component.NewOutputWriterSpinner(component.WithOutputStream(os.Stderr))
68+
runtime.SetFinalizer(spinner, func(s component.OutputWriterSpinner) {
69+
if s != nil {
70+
s.StopSpinner()
71+
}
72+
})
6773
}
6874

6975
func StopSpinner() {

0 commit comments

Comments
 (0)