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:
parent
efed17a61c
commit
7481775fcd
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user