From 5780e9020ccabdef8f1a3e6c16699825e24d36e9 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 25 Dec 2014 18:42:39 +0900 Subject: [PATCH] Fix ui.go to use defer and call glfw.SwapInterval --- ui.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui.go b/ui.go index 583f14e9c..732175f43 100644 --- a/ui.go +++ b/ui.go @@ -48,6 +48,7 @@ func init() { currentUI.run() currentUI.use(func() { opengl.Init() + glfw.SwapInterval(1) }) } @@ -175,8 +176,8 @@ func (u *ui) run() { func (u *ui) use(f func()) { ch := make(chan struct{}) u.funcs <- func() { + defer close(ch) f() - close(ch) } <-ch }