mirror of
https://github.com/rivo/tview.git
synced 2025-04-26 13:49:06 +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.
|
// Wait for "f" to return.
|
||||||
f()
|
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.
|
// Make a new screen.
|
||||||
var err error
|
var err error
|
||||||
screen, err = tcell.NewScreen()
|
screen, err = tcell.NewScreen()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user