From 072b465fa68d9c08836a29848690bedd0621acaa Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Wed, 4 Sep 2024 18:13:01 +0200 Subject: [PATCH] Fix a lock that is held too long I can only guess, but I think this was a typo (or a copy-paste-o) when this code was written. It was introduced in 55af07a1bb, and I think the defer was kept by accident; if it had been on purpose, then the statement would have been put right after the Lock call. --- pkg/gui/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gui/context.go b/pkg/gui/context.go index 66d0e5f25..bb1174991 100644 --- a/pkg/gui/context.go +++ b/pkg/gui/context.go @@ -51,7 +51,7 @@ func (self *ContextMgr) Replace(c types.Context) error { self.ContextStack = append(self.ContextStack[0:len(self.ContextStack)-1], c) } - defer self.Unlock() + self.Unlock() return self.Activate(c, types.OnFocusOpts{}) }