Skip to contentSkip to conversation

media: Fix UnregisterApplication

PATCH In review Luiz Augusto von Dentz 1 participant 2 messages Jun 23, 2021 – Jun 24, 2021 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 media: Fix UnregisterApplication

From: Luiz Augusto von Dentz <[email protected]>

UnregisterApplication is not doing anything since the apps queue is never initialized which results in not finding any application when unregistering.

---
 profiles/audio/media.c | 3 +++
 1 file changed, 3 insertions(+)
profiles/audio/media.c +3 -0
index c84bbe22d..267722542 100644
@@ -2384,6 +2384,8 @@ static void path_free(void *data)
 {
 	struct media_adapter *adapter = data;
 
+	queue_destroy(adapter->apps, app_free);
+
 	while (adapter->endpoints)
 		release_endpoint(adapter->endpoints->data);
 
@@ -2402,6 +2404,7 @@ int media_register(struct btd_adapter *btd_adapter)
 
 	adapter = g_new0(struct media_adapter, 1);
 	adapter->btd_adapter = btd_adapter_ref(btd_adapter);
+	adapter->apps = queue_new();
 
 	if (!g_dbus_register_interface(btd_get_dbus_connection(),
 					adapter_get_path(btd_adapter),
Signature · 1 line
2.31.1
author maintainer
#1 lore raw

Hi,

Quoted 34 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

UnregisterApplication is not doing anything since the apps queue is never initialized which results in not finding any application when unregistering.

---
 profiles/audio/media.c | 3 +++
 1 file changed, 3 insertions(+)
profiles/audio/media.c +3 -1
index c84bbe22d..267722542 100644
@@ -2384,6 +2384,8 @@ static void path_free(void *data)
 {
        struct media_adapter *adapter = data;
 
+       queue_destroy(adapter->apps, app_free);
+
        while (adapter->endpoints)
                release_endpoint(adapter->endpoints->data);
 
@@ -2402,6 +2404,7 @@ int media_register(struct btd_adapter *btd_adapter)
 
        adapter = g_new0(struct media_adapter, 1);
        adapter->btd_adapter = btd_adapter_ref(btd_adapter);
+       adapter->apps = queue_new();
 
        if (!g_dbus_register_interface(btd_get_dbus_connection(),
                                        adapter_get_path(btd_adapter),
--
Quoted 1 line

2.31.1

Pushed.

Signature · 1 line
Luiz Augusto von Dentz