Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile: windows: app.Main() call does not return when func(app.App) returns #49499

Open
JamesDunne opened this issue Nov 10, 2021 · 0 comments
Open

Comments

@JamesDunne
Copy link

@JamesDunne JamesDunne commented Nov 10, 2021

What version of Go are you using (go version)?

$ go version
go version go1.17.2 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Jaymz\AppData\Local\go-build
set GOENV=C:\Users\Jaymz\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Jaymz\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Jaymz\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.17.2
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Jaymz\AppData\Local\Temp\go-build805735656=/tmp/go-build -gno-record-gcc-switches

What did you do?

https://play.golang.org/p/ELzs_0Lu2NZ

What did you expect to see?

When closing the main window, the process should exit and should see both "done" and "main exited" written to log.

What did you see instead?

The process does not exit and only "done" is written to the log. The app.Main(appMain) function does not return when appMain returns.

Expectation based on this documentation: https://pkg.go.dev/golang.org/x/mobile@v0.0.0-20211109191125-d61a72f26a1a/app?GOOS=windows#hdr-Event_processing_in_Native_Apps

An app is expected to call the Main function in main.main. When the function exits, the app exits.

This does not appear to be the case, at least on Windows OS. Other platforms not tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants