From 0276be6c69156cff1129864bc807fc0710a9bc8a Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 23 Jul 2016 18:57:19 +0900 Subject: [PATCH] ui: Refactoring --- run.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/run.go b/run.go index 75eb49840..b8c2d7054 100644 --- a/run.go +++ b/run.go @@ -73,7 +73,10 @@ func Run(f func(*Image) error, width, height int, scale float64, title string) e ch := make(chan error) go func() { g := newGraphicsContext(f) - ch <- loop.Run(g, width, height, scale, title, FPS) + if err := loop.Run(g, width, height, scale, title, FPS); err != nil { + ch <- err + } + close(ch) }() ui.Main() return <-ch