summaryrefslogtreecommitdiff
path: root/pkg/backend
diff options
context:
space:
mode:
authorkali <kali@leap.se>2021-02-03 22:49:03 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-02-08 23:32:19 +0100
commit44c69b1e73aa1d408f8b0567bd5d910728e31c3c (patch)
tree6fc0882e7ecce23fe66c640ce9b3e960b3a287b8 /pkg/backend
parenta7dcea9a6e6e5b4b2eccc2ed0d6803c8408ffd0e (diff)
[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.
Diffstat (limited to 'pkg/backend')
-rw-r--r--pkg/backend/status.go5
1 files changed, 5 insertions, 0 deletions
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 {