소스 검색

Corrected possible memory leak #993

Ray 5 년 전
부모
커밋
1878a9ea01
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/raudio.c

+ 5 - 1
src/raudio.c

@@ -474,7 +474,11 @@ static void InitAudioBufferPool()
 // Close the audio buffers pool
 static void CloseAudioBufferPool()
 {
-    for (int i = 0; i < MAX_AUDIO_BUFFER_POOL_CHANNELS; i++) RL_FREE(audioBufferPool[i]);
+    for (int i = 0; i < MAX_AUDIO_BUFFER_POOL_CHANNELS; i++) 
+    {
+        RL_FREE(audioBufferPool[i]->buffer);
+        RL_FREE(audioBufferPool[i]);
+    }
 }
 
 //----------------------------------------------------------------------------------