-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
app.quit()
causes panics
#743
Comments
Thanks for opening this @ErikNatanael ! I remember when #712 landed thinking that it was a clever hack to add the
Just to clarify, your issue is specifically with the I think the proper fix is likely to not clear all windows on |
Thanks for having a look @mitchmintree !
Ah yes, I should clarify. The
Sounds like a great solution from my point of view! Having just one path to exiting seems more easily maintainable as well. |
Just realised the panic I had with |
Using the approach in the draw_capture_hi_res example of waiting for captured frames doesn't work if you want to manually quite the program at some point.
quit
seems to only destroy the windows, but leaves the run loop running which depends on there being a window, as does theexit
callback in question:https://github.com/nannou-org/nannou/blob/master/examples/draw/draw_capture_hi_res.rs#L190
Exiting with the ESCAPE key does things in the opposite order:
Reference: https://github.com/nannou-org/nannou/blob/master/nannou/src/app.rs#L1321
Waiting manually by calling the code in the
exit
callback and then callingapp.quit()
sometimes works and sometimes panics.It would be nice if the behaviour of app.quit() was consistent with hitting the ESCAPE key e.g. by setting a flag that is checked in the run_loop.
The text was updated successfully, but these errors were encountered: