Skip to content

Commit

Permalink
Fixed memory leak bug in C demo
Browse files Browse the repository at this point in the history
  • Loading branch information
chenguoguo committed May 4, 2017
1 parent 1f6625c commit 5f4138c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/C/demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ void StartAudioCapturing(int sample_rate,
}

void StopAudioCapturing() {
if (g_data != NULL) {
free(g_data);
g_data = NULL;
}
Pa_StopStream(g_pa_stream);
Pa_CloseStream(g_pa_stream);
Pa_Terminate();
Expand Down

0 comments on commit 5f4138c

Please sign in to comment.