From c2317a1f99ff778010385aad11745eb75d6a1900 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Thu, 16 Dec 2021 13:54:03 +0100 Subject: [bug] fix osx quits from app menu and dock aboutToQuit let us catch Quits coming from the osx menu or the dock. --- pkg/helper/darwin.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'pkg/helper') diff --git a/pkg/helper/darwin.go b/pkg/helper/darwin.go index a9f8e00..2db92a5 100644 --- a/pkg/helper/darwin.go +++ b/pkg/helper/darwin.go @@ -36,6 +36,7 @@ import ( "path/filepath" "strconv" "strings" + "time" "github.com/sevlyar/go-daemon" ) @@ -135,9 +136,16 @@ func firewallStop() error { log.Printf("An error ocurred stopping the firewall: %v", out) /* TODO return error if different from anchor not exists */ /*return errors.New("Error while stopping firewall")*/ - return nil } - return nil + for _ = range [50]int{} { + if firewallIsUp() { + log.Printf("Firewall still up, waiting...") + time.Sleep(200 * time.Millisecond) + } else { + return nil + } + } + return errors.New("Could not stop firewall") } func firewallIsUp() bool { -- cgit v1.2.3