diff --git a/internal/graphicsdriver/opengl/context_mobile.go b/internal/graphicsdriver/opengl/context_mobile.go index 612b0a5f5..e609144b6 100644 --- a/internal/graphicsdriver/opengl/context_mobile.go +++ b/internal/graphicsdriver/opengl/context_mobile.go @@ -73,7 +73,7 @@ type contextImpl struct { worker mgl.Worker } -func (c *context) doWork(chError <-chan error, chDone <-chan struct{}) error { +func (c *context) doWork(chDone <-chan struct{}) error { if c.worker == nil { panic("not reached") } @@ -82,8 +82,6 @@ func (c *context) doWork(chError <-chan error, chDone <-chan struct{}) error { loop: for { select { - case err := <-chError: - return err case <-workAvailable: c.worker.DoWork() case <-chDone: diff --git a/internal/graphicsdriver/opengl/driver_mobile.go b/internal/graphicsdriver/opengl/driver_mobile.go index 5dc354713..472ad7806 100644 --- a/internal/graphicsdriver/opengl/driver_mobile.go +++ b/internal/graphicsdriver/opengl/driver_mobile.go @@ -20,8 +20,8 @@ import ( "golang.org/x/mobile/gl" ) -func (d *Driver) DoWork(chError <-chan error, chDone <-chan struct{}) error { - return d.context.doWork(chError, chDone) +func (d *Driver) DoWork(chDone <-chan struct{}) error { + return d.context.doWork(chDone) } func (d *Driver) Init() { diff --git a/internal/ui/ui_mobile.go b/internal/ui/ui_mobile.go index f68dcc4de..454b8a2f8 100644 --- a/internal/ui/ui_mobile.go +++ b/internal/ui/ui_mobile.go @@ -52,8 +52,10 @@ func Render(chError <-chan error) error { } // TODO: Check this is called on the rendering thread select { + case err := <-chError: + return err case renderCh <- struct{}{}: - return opengl.Get().DoWork(chError, renderChEnd) + return opengl.Get().DoWork(renderChEnd) case <-time.After(500 * time.Millisecond): // This function must not be blocked. We need to break for timeout. return nil