diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-01-23 22:03:23 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-01-23 22:03:23 -0500 |
| commit | 74cf86d3bf324b497622a8ffb2d20399f620b23f (patch) | |
| tree | 146014e91adef6f8c13d00cd575fd0e530e62665 /focus.go | |
| parent | fa3575ff99bfe62c50be56a124076735365438be (diff) | |
| download | volute-74cf86d3bf324b497622a8ffb2d20399f620b23f.zip | |
graceful shutdown of goroutines
Diffstat (limited to 'focus.go')
| -rw-r--r-- | focus.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -19,6 +19,14 @@ func NewFocus(rows []int) Focus { return f } +func (f *Focus) Close() { + for i := range f.widgets { + for j := range f.widgets[i] { + close(f.widgets[i][j]) + } + } +} + func (f *Focus) Left() { f.widgets[f.p.Y][f.p.X] <- false if f.p.X <= 0 { |