On Windows, tcell.Screen.Fini() sends a resize event before sending nil. Fixed resulting deadlock. Fixes #179

This commit is contained in:
Oliver 2018-11-19 10:35:28 +01:00
parent 8cf347b745
commit 1bfe98092c
1 changed files with 5 additions and 1 deletions

View File

@ -167,7 +167,8 @@ func (a *Application) Run() error {
screen := a.screen
a.RUnlock()
if screen == nil {
// We have no screen. We might need to stop.
// We have no screen. Let's stop.
a.QueueEvent(nil)
break
}
@ -238,6 +239,9 @@ EventLoop:
a.RLock()
screen := a.screen
a.RUnlock()
if screen == nil {
continue
}
screen.Clear()
a.draw()
}