Skip to content
Snippets Groups Projects
Verified Commit 340834ba authored by meskio's avatar meskio :tent:
Browse files

Close bitmask when the systray quits

parent 3b4c2e8c
No related branches found
Tags 0.18.9
No related merge requests found
......@@ -3,6 +3,7 @@ package bitmask
import (
"encoding/json"
"errors"
"log"
"github.com/pebbe/zmq4"
)
......@@ -43,6 +44,10 @@ func (b *Bitmask) GetStatusCh() chan string {
// Close the connection to bitmask
func (b *Bitmask) Close() {
_, err := b.send("core", "stop")
if err != nil {
log.Printf("Got an error stopping bitmaskd: %v", err)
}
b.coresoc.Close()
}
......
......@@ -22,6 +22,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
defer b.Close()
run(b, conf)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment