Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profiles/audio/media.c: UnregisterApplication does nothing #126

Closed
pv opened this issue Apr 10, 2021 · 1 comment
Closed

profiles/audio/media.c: UnregisterApplication does nothing #126

pv opened this issue Apr 10, 2021 · 1 comment

Comments

@pv
Copy link
Contributor

pv commented Apr 10, 2021

UnregisterApplication always reports that the media application to be removed does not exist.

This is because media_adapter->apps queue seems to never be created with queue_new(), and is always NULL. Maybe needs something like this (not properly tested)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index c84bbe22d..267722542 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -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),
@Vudentz
Copy link
Contributor

Vudentz commented Apr 12, 2021

@pv Looks good, please create a proper patch so we can apply upstream.

github-actions bot pushed a commit to tedd-an/bluez that referenced this issue Jun 23, 2021
UnregisterApplication is not doing anything since the apps queue is
never initialized which results in not finding any application when
unregistering.

Fixes: bluez#126
github-actions bot pushed a commit to BluezTestBot/bluez that referenced this issue Jun 23, 2021
UnregisterApplication is not doing anything since the apps queue is
never initialized which results in not finding any application when
unregistering.

Fixes: bluez#126
hadess pushed a commit to hadess/bluez that referenced this issue Aug 26, 2022
UnregisterApplication is not doing anything since the apps queue is
never initialized which results in not finding any application when
unregistering.

Fixes: bluez/bluez#126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants