From 5d128adee14991c7426c59fef04d8aad711f07d8 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Thu, 1 Oct 2020 07:03:03 +1000 Subject: [PATCH] add mutexes for when looping through views --- pkg/gui/layout.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go index e27a46457..e3befd819 100644 --- a/pkg/gui/layout.go +++ b/pkg/gui/layout.go @@ -337,6 +337,7 @@ func (gui *Gui) onInitialViewsCreation() error { gui.setInitialViewContexts() // add tabs to views + gui.g.Mutexes.ViewsMutex.Lock() for _, view := range gui.g.Views() { tabs := gui.viewTabNames(view.Name()) if len(tabs) == 0 { @@ -344,6 +345,7 @@ func (gui *Gui) onInitialViewsCreation() error { } view.Tabs = tabs } + gui.g.Mutexes.ViewsMutex.Unlock() if err := gui.switchContext(gui.defaultSideContext()); err != nil { return err