diff --git a/src/drivers/fluid_pipewire.c b/src/drivers/fluid_pipewire.c index b96019e87..3e6c18e65 100644 --- a/src/drivers/fluid_pipewire.c +++ b/src/drivers/fluid_pipewire.c @@ -294,6 +294,11 @@ void delete_fluid_pipewire_audio_driver(fluid_audio_driver_t *p) fluid_pipewire_audio_driver_t *drv = (fluid_pipewire_audio_driver_t *)p; fluid_return_if_fail(drv); + if (drv->pw_loop) + { + pw_thread_loop_lock(drv->pw_loop); + } + if(drv->pw_stream) { pw_stream_destroy(drv->pw_stream); @@ -301,6 +306,7 @@ void delete_fluid_pipewire_audio_driver(fluid_audio_driver_t *p) if(drv->pw_loop) { + pw_thread_loop_unlock(drv->pw_loop); pw_thread_loop_destroy(drv->pw_loop); }