aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.go b/main.go
index 26582b7..95eee73 100644
--- a/main.go
+++ b/main.go
@@ -110,7 +110,10 @@ func run() error {
imapErr <- err
}()
- defer c.Disconnect()
+ defer func() {
+ // capture c and not evaluate it, before connect has run
+ c.Disconnect()
+ }()
}
if success := state.Fetch(); success == 0 {