diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c index 0022e4d6622b28aab6cd599085eff85e3d4507a9..09922ba06961eb7b4615e35ae9edd356929f9753 100644 --- a/src/modules/bluetooth/bluez5-util.c +++ b/src/modules/bluetooth/bluez5-util.c @@ -425,10 +425,11 @@ void pa_bluetooth_transport_put(pa_bluetooth_transport *t) { void pa_bluetooth_transport_free(pa_bluetooth_transport *t) { pa_assert(t); + pa_bluetooth_transport_set_state(t, PA_BLUETOOTH_TRANSPORT_STATE_DISCONNECTED); + if (t->destroy) t->destroy(t); - pa_bluetooth_transport_set_state(t, PA_BLUETOOTH_TRANSPORT_STATE_DISCONNECTED); pa_hashmap_remove(t->device->discovery->transports, t->path); t->device->transports[t->profile] = NULL;