aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-12 12:36:29 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-12 12:36:29 +0200
commitd8b4d5aa17f3bf3cc6c3559a39c183b4d841e86c (patch)
tree095c9a1db32ba104dd45f482fa9003f629dd6286 /ui
parentui: leave it to walk to lock thread (diff)
downloadwireguard-windows-d8b4d5aa17f3bf3cc6c3559a39c183b4d841e86c.tar.xz
wireguard-windows-d8b4d5aa17f3bf3cc6c3559a39c183b4d841e86c.zip
ui: unlock thread after raising
Diffstat (limited to 'ui')
-rw-r--r--ui/raise.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/ui/raise.go b/ui/raise.go
index 9a2794d1..7bc916a3 100644
--- a/ui/raise.go
+++ b/ui/raise.go
@@ -39,6 +39,7 @@ func RaiseUI() bool {
func WaitForRaiseUIThenQuit() {
var handle win.HWINEVENTHOOK
runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
handle, err := win.SetWinEventHook(win.EVENT_OBJECT_CREATE, win.EVENT_OBJECT_CREATE, 0, func(hWinEventHook win.HWINEVENTHOOK, event uint32, hwnd win.HWND, idObject int32, idChild int32, idEventThread uint32, dwmsEventTime uint32) uintptr {
class := make([]uint16, len(manageWindowWindowClass)+2) /* Plus 2, one for the null terminator, and one to see if this is only a prefix */
n, err := win.GetClassName(hwnd, &class[0], len(class))