Application does not lock on PollEvent() call anymore. Should resolve gridlocks when calling SetRoot() in goroutines. Resolves #6

pull/7/merge
Oliver 7 years ago
parent fee6bd1ef9
commit 17c785e1f8

@ -112,15 +112,18 @@ func (a *Application) Run() error {
// Start event loop.
for {
a.RLock()
if a.screen == nil {
a.RUnlock()
screen := a.screen
a.RUnlock()
if screen == nil {
break
}
// Wait for next event.
event := a.screen.PollEvent()
a.RUnlock()
if event == nil {
break // The screen was finalized.
}
switch event := event.(type) {
case *tcell.EventKey:
a.RLock()

Loading…
Cancel
Save