diff --git a/application.go b/application.go index f893578..bd4c5ac 100644 --- a/application.go +++ b/application.go @@ -227,13 +227,14 @@ func (a *Application) Suspend(f func()) bool { // Draw refreshes the screen. It calls the Draw() function of the application's // root primitive and then syncs the screen buffer. func (a *Application) Draw() *Application { - a.RLock() + a.Lock() + defer a.Unlock() + screen := a.screen root := a.root fullscreen := a.rootFullscreen before := a.beforeDraw after := a.afterDraw - a.RUnlock() // Maybe we're not ready yet or not anymore. if screen == nil || root == nil {