From 44c69b1e73aa1d408f8b0567bd5d910728e31c3c Mon Sep 17 00:00:00 2001 From: kali Date: Wed, 3 Feb 2021 22:49:03 +0100 Subject: [bug] fix segfault in osx with activation this is a regression that was introduced with previous changes to the menus in windows. activation segfaults in linux and osx, so capture the event only for windows. did not investigate further about the causes, but it seems like a good workaround for the time being. --- pkg/backend/status.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg') diff --git a/pkg/backend/status.go b/pkg/backend/status.go index ffa79fc..f793e2f 100644 --- a/pkg/backend/status.go +++ b/pkg/backend/status.go @@ -5,6 +5,7 @@ import ( "encoding/json" "log" "sync" + "fmt" // DEBUG "0xacab.org/leap/bitmask-vpn/pkg/bitmask" "0xacab.org/leap/bitmask-vpn/pkg/config" @@ -19,6 +20,7 @@ const ( ) var statusMutex sync.Mutex +var updateMutex sync.Mutex // ctx will be our glorious global object. // if we ever switch again to a provider-agnostic app, we should keep a map here. @@ -55,10 +57,13 @@ func (c connectionCtx) toJson() ([]byte, error) { log.Println(err) return nil, err } + fmt.Println(">>> ctx toJson done") return b, nil } func (c connectionCtx) updateStatus() { + updateMutex.Lock() + defer updateMutex.Unlock() if stStr, err := c.bm.GetStatus(); err != nil { log.Printf("Error getting status: %v", err) } else { -- cgit v1.2.3