diff options
-rw-r--r-- | lib/ui/tab.go | 5 | ||||
-rw-r--r-- | widgets/msgviewer.go | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/ui/tab.go b/lib/ui/tab.go index 7d1ce63d..4b99e4b7 100644 --- a/lib/ui/tab.go +++ b/lib/ui/tab.go @@ -1,6 +1,8 @@ package ui import ( + "io" + "github.com/gdamore/tcell" "github.com/mattn/go-runewidth" @@ -107,6 +109,9 @@ func (tabs *Tabs) Replace(contentSrc Drawable, contentTarget Drawable, name stri if tab.Content == contentSrc { tabs.Tabs[i] = replaceTab tabs.Select(i) + if c, ok := contentSrc.(io.Closer); ok { + c.Close() + } break } } diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index 35fc4b6e..e192ae6a 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -317,8 +317,9 @@ func (mv *MessageViewer) NextPart() { mv.Invalidate() } -func (mv *MessageViewer) Close() { +func (mv *MessageViewer) Close() error { mv.switcher.Cleanup() + return nil } func (ps *PartSwitcher) Invalidate() { |