Skip to content

Commit

Permalink
abort handleRedraws goroutine when reading from closed channel (#1617)
Browse files Browse the repository at this point in the history
Co-authored-by: Crash129 <[email protected]>
  • Loading branch information
Crash129 and pavhl authored Jan 18, 2024
1 parent 8c89cf8 commit 14684d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/wtf_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/olebedev/config"
"github.com/radovskyb/watcher"
"github.com/rivo/tview"

"github.com/wtfutil/wtf/cfg"
"github.com/wtfutil/wtf/support"
"github.com/wtfutil/wtf/utils"
Expand Down Expand Up @@ -93,7 +94,10 @@ func handleRedraws(tviewApp *tview.Application, redrawChan chan bool) {
}

for {
data := <-redrawChan
data, ok := <-redrawChan
if !ok {
return
}

if data {
tviewApp.Draw()
Expand Down

0 comments on commit 14684d3

Please sign in to comment.