summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--commands/msgview/close.go1
-rw-r--r--widgets/msgviewer.go17
2 files changed, 18 insertions, 0 deletions
diff --git a/commands/msgview/close.go b/commands/msgview/close.go
index 9966735..ed86405 100644
--- a/commands/msgview/close.go
+++ b/commands/msgview/close.go
@@ -25,6 +25,7 @@ func (Close) Execute(aerc *widgets.Aerc, args []string) error {
 		return errors.New("Usage: close")
 	}
 	mv, _ := aerc.SelectedTab().(*widgets.MessageViewer)
+	mv.Close()
 	aerc.RemoveTab(mv)
 	return nil
 }
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index c179070..d5bbace 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -284,6 +284,10 @@ func (mv *MessageViewer) NextPart() {
 	mv.Invalidate()
 }
 
+func (mv *MessageViewer) Close() {
+	mv.switcher.Cleanup()
+}
+
 func (ps *PartSwitcher) Invalidate() {
 	ps.DoInvalidate(ps)
 }
@@ -381,6 +385,12 @@ func (ps *PartSwitcher) MouseEvent(localX int, localY int, event tcell.Event) {
 	}
 }
 
+func (ps *PartSwitcher) Cleanup() {
+	for _, partViewer := range ps.parts {
+		partViewer.Cleanup()
+	}
+}
+
 func (mv *MessageViewer) Event(event tcell.Event) bool {
 	return mv.switcher.Event(event)
 }
@@ -593,6 +603,13 @@ func (pv *PartViewer) Draw(ctx *ui.Context) {
 	pv.term.Draw(ctx)
 }
 
+func (pv *PartViewer) Cleanup() {
+	if pv.pager != nil && pv.pager.Process != nil {
+		pv.pager.Process.Kill()
+		pv.pager = nil
+	}
+}
+
 type HeaderView struct {
 	ui.Invalidatable
 	Name  string
n> ^
189d34dc ^

17623a62 ^
189d34dc ^
17623a62 ^





189d34dc ^



7dd5a41e ^
189d34dc ^

0102aa37 ^
e8ffaf29 ^
9635163b ^

17623a62 ^














8eec3eae ^
17623a62 ^
ea62afb1 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60