1
0
mirror of https://github.com/rivo/tview.git synced 2025-04-24 13:48:56 +08:00

Application can be stopped in suspended mode. Fixes #499

This commit is contained in:
Oliver 2020-12-04 17:13:33 +01:00
parent efed17a61c
commit 7481775fcd

View File

@ -514,6 +514,14 @@ func (a *Application) Suspend(f func()) bool {
// Wait for "f" to return.
f()
// If stop was called in the meantime (a.screen is nil), we're done already.
a.RLock()
screen = a.screen
a.RUnlock()
if screen == nil {
return true
}
// Make a new screen.
var err error
screen, err = tcell.NewScreen()