From dfbd27f8a1bc5cda8b4ee4ac74850f55fed05924 Mon Sep 17 00:00:00 2001 From: Weilu Jia Date: Fri, 6 Aug 2021 00:06:59 -0700 Subject: [PATCH] Fix messagebox not being raised on all goroutines Fixes #22 --- main.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main.go b/main.go index 4bf97a4..adfbc6a 100644 --- a/main.go +++ b/main.go @@ -151,6 +151,13 @@ func main() { if !*noPatch { wg.Add(1) go func() { + // Raise an alert box on panic so non-technical users don't lose the output. + defer func() { + r := recover() + if r != nil { + panicBox(r) + } + }() defer wg.Done() watchGGST(*noClose) }() @@ -160,6 +167,13 @@ func main() { if !*noProxy { wg.Add(1) go func() { + // Raise an alert box on panic so non-technical users don't lose the output. + defer func() { + r := recover() + if r != nil { + panicBox(r) + } + }() defer wg.Done() server := proxy.CreateStriveProxy("127.0.0.1:21611", GGStriveAPIURL, PatchedAPIURL, &proxy.StriveAPIProxyOptions{AsyncStatsSet: *unsafeAsyncStatsSet})