From f9091fbce22cac4c96bb29db2801c4c5e6456c24 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Mon, 26 Apr 2021 12:35:12 -0400 Subject: [PATCH] fix segfault on quit --- src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index dc4a0e1..9a13100 100644 --- a/src/main.rs +++ b/src/main.rs @@ -140,16 +140,16 @@ fn main() { .create_statistics(&game_core, draw_handle.get_time()); game_core.progress.update(&new_progress); - // For now, just quit - // This also throws a SEGFAULT.. yay for unsafe code.. - unsafe { - raylib::ffi::CloseWindow(); - } + // Break the render loop + break; } game_core.switch_state(new_state, Some(&draw_handle)); } + // Feed the audio engine + // audio_system.update(); + // Feed the profiler // This only runs in the dev profile. #[cfg(debug_assertions)]