on refresh, recreate raw too, because i dont wanna be leaking by not Closing on refresh

This commit is contained in:
bel
2023-03-25 10:13:25 -06:00
parent 50e89492cf
commit 51ae1b27b4
2 changed files with 5 additions and 2 deletions

View File

@@ -33,7 +33,10 @@ func NewRefresh(newWrap func() Wrap, ch <-chan os.Signal) *Refresh {
return
case sig := <-ch:
log.Println("refreshing for", sig)
result.input = newWrap()
newInput := newWrap()
oldInput := result.input
result.input = newInput
oldInput.Close()
}
}
}()