shiny/driver/mtldriver: select on receiving from newWindowCh
This is a fixup to CL 208877. The intention there was to select
between receiving a value from the newWindowCh or done channels.
Instead, it was receiving only on the newWindowCh channel,
before proceeding to select between sending to newWindowCh
and receiving from done. That means a shiny program that doesn't
open a window could never exit. This change fixes that.
Reviewed-by: Brad Fitzpatrick <firstname.lastname@example.org>
diff --git a/shiny/driver/mtldriver/mtldriver.go b/shiny/driver/mtldriver/mtldriver.go
index 8b50b22..2c0e3c4 100644
@@ -71,7 +71,8 @@
// TODO(dmitshur): Delete this when https://github.com/go-gl/glfw/issues/262 is resolved.
// Wait for first window request (or done) before entering main
// loop to work around https://github.com/glfw/glfw/issues/1543.
- case newWindowCh <- <-newWindowCh:
+ case w := <-newWindowCh:
+ newWindowCh <- w