Skip to content

[v2] runtime.Quit on windows not working #926

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

Closed
leaanthony opened this issue Nov 9, 2021 · 4 comments
Closed

[v2] runtime.Quit on windows not working #926

leaanthony opened this issue Nov 9, 2021 · 4 comments
Labels
Bug Something isn't working

Comments

@leaanthony
Copy link
Member

Hey, I've been playing around with v2 really liking it so far!
I noticed that I cannot close the app with runtime.Quit(ctx) on Windows for some reason. However, I tested in on Mac and it seems to work fine.
Tested on fresh project as well, steps:
wails init -n test
add couple of lines in startup

time.Sleep(5 * time.Second)
runtime.Quit(ctx)

wails build and execute the binary, window stays open. Do you have any insight?
I was actually looking for a way to restart the app, do you think that would be a useful addition to the project?
Thanks : )

Originally posted by @stefpap in #828 (comment)

@leaanthony leaanthony added Bug Something isn't working TODO The issue is ready to be developed labels Nov 9, 2021
@leaanthony
Copy link
Member Author

If you try and kill it in startup, it won't quit properly because a number of things are in flight.
It does seem to work as expected - add a Quit to the button callback and see it in action.

// Greet returns a greeting for the given name
func (b *App) Greet(name string) string {
	runtime.Quit(b.ctx)
	return fmt.Sprintf("Hello %s, It's show time!", name)
}

@stefpap
Copy link
Contributor

stefpap commented Nov 11, 2021

Thanks for the fast reply and sorry for wasting your time Lea

@leaanthony
Copy link
Member Author

No worries, you found a gap in the docs. Will update 👍

@leaanthony leaanthony reopened this Nov 11, 2021
@leaanthony leaanthony added Fixed on Master and removed TODO The issue is ready to be developed labels Nov 17, 2021
@leaanthony
Copy link
Member Author

Updated docs 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants