diff --git a/src/gst/gstpipewiredeviceprovider.c b/src/gst/gstpipewiredeviceprovider.c index a9d8dd8b2..9f82507b3 100644 --- a/src/gst/gstpipewiredeviceprovider.c +++ b/src/gst/gstpipewiredeviceprovider.c @@ -665,11 +665,16 @@ gst_pipewire_device_provider_stop (GstDeviceProvider * provider) { GstPipeWireDeviceProvider *self = GST_PIPEWIRE_DEVICE_PROVIDER (provider); - pw_thread_loop_lock (self->core->loop); + /* 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); - pw_thread_loop_unlock (self->core->loop); + if (self->core != NULL) { + pw_thread_loop_unlock (self->core->loop); + } g_clear_pointer (&self->core, gst_pipewire_core_release); }