From 909f2fe4920bf0b0598823cea73d6ec43e3169e4 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 25 Sep 2022 23:56:09 +0900 Subject: [PATCH] internal/ui: bug fix: make inFrame concurrent-safe Updates #1816 --- internal/ui/ui_glfw.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index 18a10fb56..3dd6dcbad 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -728,11 +728,15 @@ func (u *userInterfaceImpl) createWindow(width, height int) error { } func (u *userInterfaceImpl) beginFrame() { - u.inFrame = true + u.t.Call(func() { + u.inFrame = true + }) } func (u *userInterfaceImpl) endFrame() { - u.inFrame = false + u.t.Call(func() { + u.inFrame = false + }) } // registerWindowSetSizeCallback must be called from the main thread.