summaryrefslogtreecommitdiffstats
path: root/pkg/gui/layout.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-10-01 07:03:03 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-10-02 08:09:42 +1000
commit5d128adee14991c7426c59fef04d8aad711f07d8 (patch)
treeba4bd2b34c13c58948aa280bdbbfc930b09d8f56 /pkg/gui/layout.go
parent71d4c552aff78fc4095a3fd03b1e250511fbb13f (diff)
add mutexes for when looping through views
Diffstat (limited to 'pkg/gui/layout.go')
-rw-r--r--pkg/gui/layout.go2
1 files changed, 2 insertions, 0 deletions
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