Skip to content

Commit

Permalink
added pa_context_disconnect() to fix #165
Browse files Browse the repository at this point in the history
also added pa_context_unref() and pa_mainloop_free() to fix memory leaks
in the getdefaultsink function.
  • Loading branch information
karlstav committed Jun 5, 2017
1 parent 25f2148 commit d8df114
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion input/fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ struct audio_data {
int audio_out_l[2048];
int format;
unsigned int rate ;
char *source ; //alsa device, fifo path or pulse source
char *source; //alsa device, fifo path or pulse source
int im; //input mode alsa, fifo or pulse
int channels;
int terminate; // shared variable used to terminate audio thread
Expand Down
3 changes: 3 additions & 0 deletions input/pulse.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ void cb(__attribute__((unused)) pa_context *pulseaudio_context, const pa_server_
audio->source = strcat(audio->source, ".monitor");

//quiting mainloop
pa_context_disconnect(pulseaudio_context);
pa_context_unref(pulseaudio_context);
pa_mainloop_quit(m_pulseaudio_mainloop, 0);
pa_mainloop_free(m_pulseaudio_mainloop);
}


Expand Down

0 comments on commit d8df114

Please sign in to comment.