diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-11-01 14:08:58 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-11-06 23:18:25 +0100 |
commit | 5540e3efb83e5bc50dc4600d5e66c16fca25451a (patch) | |
tree | 8e6ed9dd92c629346e0bb0e1edd5ce90cf1fce5c /widgets | |
parent | 1f682fc610de1beb57c68b92fe98bf057483773c (diff) | |
download | aerc-5540e3efb83e5bc50dc4600d5e66c16fca25451a.tar.gz |
split: close current split after replacing with new
Close the current split view after replacing it with a new view.
Previously we closed it before replacing it with the new split view
which could create a race condition when attempting the replace.
Reported-by: Bence Ferdinandy <bence@ferdinandy.com>
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/account.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/widgets/account.go b/widgets/account.go index f1360b8f..5bbe97e1 100644 --- a/widgets/account.go +++ b/widgets/account.go @@ -517,9 +517,6 @@ func (acct *AccountView) UpdateSplitView() { acct.splitDebounce.Stop() } fn := func() { - if acct.split != nil { - acct.split.Close() - } msg, err := acct.SelectedMessage() if err != nil { return @@ -533,6 +530,9 @@ func (acct *AccountView) UpdateSplitView() { orig := acct.split acct.split = NewMessageViewer(acct, acct.conf, view) acct.grid.ReplaceChild(orig, acct.split) + if orig != nil { + orig.Close() + } }) acct.splitMsg = msg ui.Invalidate() |