summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorveins1 <[email protected]>2022-10-02 22:30:26 +0500
committerGitHub <[email protected]>2022-10-02 19:30:26 +0200
commit2872b2fff5c897b09029b3eaa6556621a8a0f189 (patch)
tree3ed0d25dc1adaffbefd8ca872ee204cfb7c5f59c
parent33e7f7cc59df39021f2c289f44edc25843c8bb75 (diff)
downloadraylib-2872b2fff5c897b09029b3eaa6556621a8a0f189.tar.gz
raylib-2872b2fff5c897b09029b3eaa6556621a8a0f189.zip
Clear PCM buffer state when closing audio device (#2736)
Fix for #2714
-rw-r--r--src/raudio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/raudio.c b/src/raudio.c
index 78d3ebd3..d1b47f64 100644
--- a/src/raudio.c
+++ b/src/raudio.c
@@ -509,7 +509,9 @@ void CloseAudioDevice(void)
AUDIO.System.isReady = false;
RL_FREE(AUDIO.System.pcmBuffer);
-
+ AUDIO.System.pcmBuffer = NULL;
+ AUDIO.System.pcmBufferSize = 0;
+
TRACELOG(LOG_INFO, "AUDIO: Device closed successfully");
}
else TRACELOG(LOG_WARNING, "AUDIO: Device could not be closed, not currently initialized");