-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
println seems to prevent proper App exit #3334
Comments
Are you able to reproduce on Maybe something is holding a lock on |
For me diff --git a/examples/2d/contributors.rs b/examples/2d/contributors.rs
index cefce614..54cb40a9 100644
--- a/examples/2d/contributors.rs
+++ b/examples/2d/contributors.rs
@@ -1,4 +1,4 @@
-use bevy::{prelude::*, utils::HashSet};
+use bevy::{prelude::*, utils::HashSet, app::AppExit};
use rand::{prelude::SliceRandom, Rng};
use std::{
env::VarError,
@@ -15,9 +15,20 @@ fn main() {
.add_system(move_system)
.add_system(collision_system)
.add_system(select_system)
+ .add_system(quit)
.run();
}
+fn quit(
+ keys: Res<Input<KeyCode>>,
+ mut exit: EventWriter<AppExit>
+) {
+ if keys.pressed(KeyCode::LControl) && keys.pressed(KeyCode::C) {
+ println!("Exiting...");
+ exit.send(AppExit);
+ }
+}
+
// Store contributors in a collection that preserves the uniqueness
type Contributors = HashSet<String>; works just fine as of add1818. What did you do to reproduce it @DJMcNab? |
I couldn't reproduce on another pc ! |
Yes they do happen! This might be a minor issue that I randomly encountered after all ! |
I'm going to close this out then: if anyone else encounters this or can reproduce we'll reopen it :) |
Hi, encountering this as well on Bevy 0.6. Removing EDIT: Actually, now encountering it even without the |
I have the same problem without any println. I'm using Arch Linux and bevy 0.8. Is there an issue that addresses this problem? |
@jakoschiko is it similar to #5524 ? |
Issue Encountered:
Trying to exit the game with exit.send(AppExit).
The window closes but the program's process is still running and terminal window hangs.
After removing all println() from the code, the App exits properly.
Code that might help to reproduce :
Bevy 0.5.0
OS: Linux
The text was updated successfully, but these errors were encountered: