From 7ccc29e3c76cb2582efe0b6dbf03bf5e9a35853a Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 19 May 2020 04:08:30 +0900 Subject: [PATCH] uidriver/js: Clean up --- internal/uidriver/js/ui.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/uidriver/js/ui.go b/internal/uidriver/js/ui.go index 8a7db84ff..f8e449b72 100644 --- a/internal/uidriver/js/ui.go +++ b/internal/uidriver/js/ui.go @@ -203,10 +203,11 @@ func (u *UserInterface) loop(context driver.UIContext) <-chan error { } else { setTimeout.Invoke(cf, 0) } - return } + // TODO: Should cf be released after the game ends? cf = js.FuncOf(func(this js.Value, args []js.Value) interface{} { + // f can be blocked but callbacks must not be blocked. Create a goroutine (#1161). go f() return nil })