Commit 0b260781 authored by pali's avatar pali

bluetooth: Fix crash when destroying transports

Ensure that transport has still allocated memory when hooks (triggered by pa_bluetooth_transport_set_state) are calling
parent 5f4a1844
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment