Add a destroy function to the transport that is called before freeing
the transport. Useful for cleaning up extra userdata.
void pa_bluetooth_transport_free(pa_bluetooth_transport *t) {
pa_assert(t);
+ if (t->destroy)
+ t->destroy(t);
pa_bluetooth_transport_unlink(t);
pa_xfree(t->owner);
typedef int (*pa_bluetooth_transport_acquire_cb)(pa_bluetooth_transport *t, bool optional, size_t *imtu, size_t *omtu);
typedef void (*pa_bluetooth_transport_release_cb)(pa_bluetooth_transport *t);
+typedef void (*pa_bluetooth_transport_destroy_cb)(pa_bluetooth_transport *t);
struct pa_bluetooth_transport {
pa_bluetooth_device *device;
pa_bluetooth_transport_acquire_cb acquire;
pa_bluetooth_transport_release_cb release;
+ pa_bluetooth_transport_destroy_cb destroy;
void *userdata;
};