Browse Source

Clear PCM buffer state when closing audio device (#2736)

Fix for #2714
veins1 2 years ago
parent
commit
2872b2fff5
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/raudio.c

+ 3 - 1
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");