Skip to content

Commit

Permalink
abort handleRedraws goroutine when reading from closed channel
Browse files Browse the repository at this point in the history
  • Loading branch information
pavhl committed Oct 26, 2023
1 parent 3d150a2 commit 65faacd
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 65faacd

Please sign in to comment.