diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-07 21:45:57 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-10 00:23:01 +1100 |
commit | 795e4da8b8fa08eb2e55cd7587ddba077402e9ad (patch) | |
tree | 05d71ef0b00522fad3ac4878bf13a2914f22599d /pkg/gui/line_by_line_panel.go | |
parent | 79e59d5460d838203bc79ac86c0ba529305ba2a9 (diff) |
do not put mutexes on state else we might unlock an unlocked mutex
Diffstat (limited to 'pkg/gui/line_by_line_panel.go')
-rw-r--r-- | pkg/gui/line_by_line_panel.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/gui/line_by_line_panel.go b/pkg/gui/line_by_line_panel.go index cb93468a3..96c29bc6d 100644 --- a/pkg/gui/line_by_line_panel.go +++ b/pkg/gui/line_by_line_panel.go @@ -25,8 +25,8 @@ const ( // returns whether the patch is empty so caller can escape if necessary // both diffs should be non-coloured because we'll parse them and colour them here func (gui *Gui) refreshLineByLinePanel(diff string, secondaryDiff string, secondaryFocused bool, selectedLineIdx int) (bool, error) { - gui.State.Mutexes.LineByLinePanelMutex.Lock() - defer gui.State.Mutexes.LineByLinePanelMutex.Unlock() + gui.Mutexes.LineByLinePanelMutex.Lock() + defer gui.Mutexes.LineByLinePanelMutex.Unlock() state := gui.State.Panels.LineByLine @@ -418,8 +418,8 @@ func (gui *Gui) lineByLineNavigateTo(selectedLineIdx int) error { } func (gui *Gui) withLBLActiveCheck(f func(*lineByLinePanelState) error) error { - gui.State.Mutexes.LineByLinePanelMutex.Lock() - defer gui.State.Mutexes.LineByLinePanelMutex.Unlock() + gui.Mutexes.LineByLinePanelMutex.Lock() + defer gui.Mutexes.LineByLinePanelMutex.Unlock() state := gui.State.Panels.LineByLine if state == nil { |