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

Closed
JamesDunne opened this issue Nov 10, 2021 · 1 comment
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@JamesDunne
Copy link

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.

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Nov 10, 2021
@gopherbot gopherbot added this to the Unreleased milestone Nov 10, 2021
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 12, 2021
@gopherbot
Copy link

Change https://golang.org/cl/369196 mentions this issue: app: allow app.Main to return on Windows

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants