From 399c0162c99cf0477dade0f04c976b8733f120e0 Mon Sep 17 00:00:00 2001 From: Chandra Pamuluri Date: Wed, 1 May 2024 16:12:42 -0500 Subject: [PATCH] finalizer --- pkg/pluginmanager/manager.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/pluginmanager/manager.go b/pkg/pluginmanager/manager.go index 4d136d714..f641fd249 100644 --- a/pkg/pluginmanager/manager.go +++ b/pkg/pluginmanager/manager.go @@ -11,6 +11,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "strings" "github.com/Masterminds/semver" @@ -64,6 +65,11 @@ var spinner component.OutputWriterSpinner func init() { // Initialize global spinner spinner = component.NewOutputWriterSpinner(component.WithOutputStream(os.Stderr)) + runtime.SetFinalizer(spinner, func(s component.OutputWriterSpinner) { + if s != nil { + s.StopSpinner() + } + }) } func StopSpinner() {