]> git.nihav.org Git - nihav-player.git/commitdiff
sndplayer: do clean-up even if nothing was played
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 22 Sep 2026 14:08:05 +0000 (16:08 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 22 Sep 2026 14:08:05 +0000 (16:08 +0200)
sndplay/src/main.rs

index a78cbadbb83bc63eb587d998ec7b62d7d335a37b..75ad49c3f763a1d5477b8a37f6bb447f9913df8e 100644 (file)
@@ -525,6 +525,10 @@ fn main() {
 
     if args.len() == 1 {
         println!("usage: nihav-sndplay file1 file2 ...");
+
+        cmd_state.restore();
+        drop(cmd_reader_thread);
+        unsafe { sdl2_sys::SDL_Quit(); }
         return;
     }
 
@@ -540,6 +544,10 @@ fn main() {
         println!("  pgup / pgdn     - seek 10 minutes forward / back");
         println!("  + / -           - increase / decrease volume");
         println!("  m               - mute output");
+
+        cmd_state.restore();
+        drop(cmd_reader_thread);
+        unsafe { sdl2_sys::SDL_Quit(); }
         return;
     }