ui: Panic when error is found on mobile

This commit is contained in:
Hajime Hoshi 2018-04-07 03:33:20 +09:00
parent 2d3c6ab5b8
commit 899f007fd0

View File

@ -150,7 +150,12 @@ func Run(width, height int, scale float64, title string, g GraphicsContext, main
// RunMainThreadLoop runs the main routine for gomobile-build. // RunMainThreadLoop runs the main routine for gomobile-build.
func RunMainThreadLoop(ch <-chan error) error { func RunMainThreadLoop(ch <-chan error) error {
// TODO: ch should be used go func() {
// As mobile apps never ends, RunMainThreadLoop can't return.
// Just panic here.
err := <-ch
panic(err)
}()
app.Main(appMain) app.Main(appMain)
return nil return nil
} }