From 8eadceac21a87a472acf98b36770685d459b63cb Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Thu, 26 Feb 2026 17:05:17 +0100 Subject: [PATCH] - --- libao/libao.rkt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libao/libao.rkt b/libao/libao.rkt index b5bb368..d7cd10a 100644 --- a/libao/libao.rkt +++ b/libao/libao.rkt @@ -156,11 +156,16 @@ (if (number? handle) (let ((ao-device (hash-ref devices handle #f))) - (close-device #f ao-device)) + (unless (eq? ao-device #f) + (displayln (format "Closing ao device ~a" ao-device)) + (close-device #f ao-device) + (hash-remove! devices handle))) (let ((handle-num (ao-handle-handle-num handle))) (let ((ao-device (hash-ref devices handle-num #f))) - (displayln (format "ao-device = ~a" ao-device)) - (close-device handle ao-device)) + (unless (eq? ao-device #f) + (displayln (format "ao-device = ~a" ao-device)) + (close-device handle ao-device) + (hash-remove! devices handle-num))) ) ) )