mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
gst: Prevent a crash when stopping device provider
The provider might fail to connect to the PipeWire core when starting up, so when stopping we need to check the core is valid before attempting to acquire a mutex on its loop.
This commit is contained in:
parent
31cd694602
commit
140374d207
1 changed files with 7 additions and 2 deletions
|
|
@ -665,11 +665,16 @@ gst_pipewire_device_provider_stop (GstDeviceProvider * provider)
|
|||
{
|
||||
GstPipeWireDeviceProvider *self = GST_PIPEWIRE_DEVICE_PROVIDER (provider);
|
||||
|
||||
/* core might be NULL if we failed to connect in _start. */
|
||||
if (self->core != NULL) {
|
||||
pw_thread_loop_lock (self->core->loop);
|
||||
}
|
||||
GST_DEBUG_OBJECT (self, "stopping provider");
|
||||
|
||||
g_clear_pointer ((struct pw_proxy**)&self->registry, pw_proxy_destroy);
|
||||
if (self->core != NULL) {
|
||||
pw_thread_loop_unlock (self->core->loop);
|
||||
}
|
||||
g_clear_pointer (&self->core, gst_pipewire_core_release);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue