fix: Close unused MessageView when swapping view

Closes https://todo.sr.ht/~sircmpwn/aerc2/379

The old `MessageView` was not closed when replacing the tab content, which
causes a memory leak.
This commit is contained in:
Ray Ganardi 2020-04-16 19:29:36 +02:00 committed by Drew DeVault
parent f35002ad0e
commit 5b751b6d6d
2 changed files with 7 additions and 1 deletions

View file

@ -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() {