We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi!
I want run systray in separate thread, something like this:
go systray.Run(onReady, onExit) fmt.Println("test1") time.Sleep(10000 * time.Millisecond) fmt.Println("test2")
All run as expected on Windows, but crash on MacOS:
bash-3.2$ go build && ./example test1 2019-06-15 20:51:58.662 example[60748:2170198] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /BuildRoot/Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1575.12/Foundation/Misc.subproj/NSUndoManager.m:361 2019-06-15 20:51:58.663 example[60748:2170198] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.' *** First throw call stack: ( 0 CoreFoundation 0x00007fff52e0ecfd __exceptionPreprocess + 256 1 libobjc.A.dylib 0x00007fff7d4b5a17 objc_exception_throw + 48 2 CoreFoundation 0x00007fff52e29a1a +[NSException raise:format:arguments:] + 98 3 Foundation 0x00007fff550c8c85 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194 4 Foundation 0x00007fff54ffbcfa +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 473 5 AppKit 0x00007fff503d6915 -[NSApplication run] + 916 6 example 0x00000000042632e0 nativeLoop + 128 7 example 0x00000000042627ea _cgo_67d7e7d56c36_Cfunc_nativeLoop + 26 8 example 0x0000000004058aa0 runtime.asmcgocall + 112 ) libc++abi.dylib: terminating with uncaught exception of type NSException SIGABRT: abort PC=0x7fff7edbe2c6 m=6 sigcode=0 signal arrived during cgo execution goroutine 18 [syscall, locked to thread]: runtime.cgocall(0x42627d0, 0xc000030798, 0xc000076301) /usr/local/go/src/runtime/cgocall.go:128 +0x5b fp=0xc000030768 sp=0xc000030730 pc=0x4004f9b github.com/getlantern/systray._Cfunc_nativeLoop(0x0) _cgo_gotypes.go:107 +0x49 fp=0xc000030798 sp=0xc000030768 pc=0x4260dd9 github.com/getlantern/systray.nativeLoop(...) /Users/nightman/go/src/github.com/getlantern/systray/systray_nonwindows.go:19 github.com/getlantern/systray.Run(0x430ed48, 0x430ed30) /Users/nightman/go/src/github.com/getlantern/systray/systray.go:81 +0x7f fp=0xc0000307d0 sp=0xc000030798 pc=0x426071f runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc0000307d8 sp=0xc0000307d0 pc=0x4059301 created by main.main /Users/nightman/Downloads/1/systray-master/example/main.go:21 +0x51 goroutine 1 [sleep]: runtime.goparkunlock(...) /usr/local/go/src/runtime/proc.go:307 time.Sleep(0x2540be400) /usr/local/go/src/runtime/time.go:105 +0x159 main.main() /Users/nightman/Downloads/1/systray-master/example/main.go:23 +0xbd goroutine 34 [chan receive]: github.com/getlantern/systray.Run.func2(0xc00011c000, 0x430ed48) /Users/nightman/go/src/github.com/getlantern/systray/systray.go:66 +0x34 created by github.com/getlantern/systray.Run /Users/nightman/go/src/github.com/getlantern/systray/systray.go:65 +0xf1 rax 0x0 rbx 0x70000ac4b000 rcx 0x70000ac49488 rdx 0x0 rdi 0xb03 rsi 0x6 rbp 0x70000ac494c0 rsp 0x70000ac49488 r8 0x70000ac49350 r9 0x70000ac49520 r10 0x0 r11 0x206 r12 0xb03 r13 0x3000000008 r14 0x6 r15 0x2d rip 0x7fff7edbe2c6 rflags 0x206 cs 0x7 fs 0x0 gs 0x0
Can you help?
The text was updated successfully, but these errors were encountered:
Fix running the GUI on macOS
5ee1bbf
On macOS the GUI (github.com/getlantern/systray) should be started on the main thread. getlantern/systray#90
1584839
No branches or pull requests
Hi!
I want run systray in separate thread, something like this:
All run as expected on Windows, but crash on MacOS:
Can you help?
The text was updated successfully, but these errors were encountered: