From 47a0b3ccfabe75b54aa31c9c6c8dcfc6a2c694fb Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 1 Jul 2016 00:44:15 +0900 Subject: [PATCH] ui: Need LockOSThread for mobile --- internal/ui/ui_mobile.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/ui/ui_mobile.go b/internal/ui/ui_mobile.go index 802eeb48d..cb0a22452 100644 --- a/internal/ui/ui_mobile.go +++ b/internal/ui/ui_mobile.go @@ -18,6 +18,7 @@ package ui import ( "errors" + "runtime" "time" "github.com/hajimehoshi/ebiten/internal/graphics/opengl" @@ -32,6 +33,9 @@ func Main() error { } func Render(chError <-chan error) error { + runtime.LockOSThread() + defer runtime.UnlockOSThread() + if chError == nil { return errors.New("ui: chError must not be nil") }