summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs
index 3cf9d47..b5190bf 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -45,14 +45,16 @@ fn main() {
graphics::update(&mut window);
}
- // aquire state resource
- let mut game_state = match game_state.lock() {
- Ok(game_state) => game_state,
- Err(poisoned) => poisoned.into_inner(),
- };
-
- // stop game thread
- game_state.running = false;
+ {
+ // aquire state resource
+ let mut game_state = match game_state.lock() {
+ Ok(game_state) => game_state,
+ Err(poisoned) => poisoned.into_inner(),
+ };
+
+ // stop game thread
+ game_state.running = false;
+ }
});
// wait for both thread to die