Skip to content

Commit

Permalink
shiny/driver/mtldriver: select on receiving from newWindowCh
Browse files Browse the repository at this point in the history
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.

Change-Id: I1c09ea5f7bec6c9714f20428fdd90d1b756f515d
Reviewed-on: https://go-review.googlesource.com/c/exp/+/209257
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
dmitshur committed Nov 29, 2019
1 parent 9964a5a commit b0642c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shiny/driver/mtldriver/mtldriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ func main(f func(screen.Screen)) error {
// 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
case <-done:
}
for {
Expand Down

0 comments on commit b0642c6

Please sign in to comment.