mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
LibAudio: Disconnect from and unref the PulseAudio context with lock
We don't want to pull the stream out from under our PulseAudio main loop, so call these with the lock to ensure that nothing is touching them. The `pa_threaded_mainloop_stop()` call does not require lock as it sets a flag to tell the main loop to exit.
This commit is contained in:
parent
37acdc9ba7
commit
2de3cee8ea
Notes:
sideshowbarker
2024-07-16 23:51:07 +09:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/SerenityOS/serenity/commit/2de3cee8ea Pull-request: https://github.com/SerenityOS/serenity/pull/20350 Reviewed-by: https://github.com/ADKaster ✅
@ -105,8 +105,11 @@ PulseAudioContext::PulseAudioContext(pa_threaded_mainloop* main_loop, pa_mainloo
|
||||
|
||||
PulseAudioContext::~PulseAudioContext()
|
||||
{
|
||||
pa_context_disconnect(m_context);
|
||||
pa_context_unref(m_context);
|
||||
{
|
||||
auto locker = main_loop_locker();
|
||||
pa_context_disconnect(m_context);
|
||||
pa_context_unref(m_context);
|
||||
}
|
||||
pa_threaded_mainloop_stop(m_main_loop);
|
||||
pa_threaded_mainloop_free(m_main_loop);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user