Closed azr closed 5 years ago
required by PR: https://github.com/gizak/termui/pull/233
I don't think this is right since ws must trigger several time.
I only know that this definitely fixes the crashes for me. The crash happens spontaneously after resizing for a while.
Hey @mattn, ss takes all sigwinch syscalls but ss must be depleted before we close ws, otherwise panic: send on a closed channel
. The PR ensures ss
is depleted before we close ws
since the close will only happen after the range.
defer close(tty.ws)
for sig := range tty.ss {
I just understood what is happening with your explanation.
Thank you
Thanks !! Sorry, my first explanation was not the clearest 🙂
sometimes it's possible to receive a SIGWINCH right in between when
close(tty.ss)
andclose(tty.ws)
are being called, causing a panic.Making the
WINSIZE
production goroutine close the chan will prevent this.