Skip to content

Commit

Permalink
Fix crash when using pulseaudio
Browse files Browse the repository at this point in the history
The main loop should be freed only after it has stopped running.
  • Loading branch information
mohd-akram authored and karlstav committed Jun 2, 2024
1 parent 5f45736 commit 7e0aeb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion input/pulse.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ void cb(__attribute__((unused)) pa_context *pulseaudio_context, const pa_server_
pa_context_disconnect(pulseaudio_context);
pa_context_unref(pulseaudio_context);
pa_mainloop_quit(m_pulseaudio_mainloop, 0);
pa_mainloop_free(m_pulseaudio_mainloop);
}

void pulseaudio_context_state_callback(pa_context *pulseaudio_context, void *userdata) {
Expand Down Expand Up @@ -96,6 +95,7 @@ void getPulseDefaultSink(void *data) {
}

pa_mainloop_run(m_pulseaudio_mainloop, &ret);
pa_mainloop_free(m_pulseaudio_mainloop);
}

void *input_pulse(void *data) {
Expand Down

0 comments on commit 7e0aeb9

Please sign in to comment.