mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-12 13:34:41 +08:00
transport: Keep a list o all existent transports
This commit is contained in:
parent
be8954bdc6
commit
a17e2e7087
@ -107,6 +107,8 @@ struct media_transport {
|
||||
void *data;
|
||||
};
|
||||
|
||||
static GSList *transports = NULL;
|
||||
|
||||
static const char *state2str(transport_state_t state)
|
||||
{
|
||||
switch (state) {
|
||||
@ -703,6 +705,8 @@ static void media_transport_free(void *data)
|
||||
{
|
||||
struct media_transport *transport = data;
|
||||
|
||||
transports = g_slist_remove(transports, transport);
|
||||
|
||||
if (transport->owner)
|
||||
media_transport_remove_owner(transport);
|
||||
|
||||
@ -818,6 +822,8 @@ struct media_transport *media_transport_create(struct media_endpoint *endpoint,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
transports = g_slist_append(transports, transport);
|
||||
|
||||
return transport;
|
||||
|
||||
fail:
|
||||
|
Loading…
Reference in New Issue
Block a user