mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
bluez5: use for_each_safe when items can be removed
Removing items when iterating a list of only allowed when using the _safe versions of for_each
This commit is contained in:
parent
47b6ce84b2
commit
41063578a5
1 changed files with 4 additions and 4 deletions
|
|
@ -433,23 +433,23 @@ static void a2dp_codec_switch_free(struct spa_bt_a2dp_codec_switch *sw);
|
|||
|
||||
static void device_free(struct spa_bt_device *device)
|
||||
{
|
||||
struct spa_bt_remote_endpoint *ep;
|
||||
struct spa_bt_remote_endpoint *ep, *tep;
|
||||
struct spa_bt_a2dp_codec_switch *sw;
|
||||
struct spa_bt_transport *t;
|
||||
struct spa_bt_transport *t, *tt;
|
||||
struct spa_bt_monitor *monitor = device->monitor;
|
||||
|
||||
spa_log_debug(monitor->log, "%p", device);
|
||||
device_stop_timer(device);
|
||||
device_remove(monitor, device);
|
||||
|
||||
spa_list_for_each(ep, &device->remote_endpoint_list, device_link) {
|
||||
spa_list_for_each_safe(ep, tep, &device->remote_endpoint_list, device_link) {
|
||||
if (ep->device == device) {
|
||||
spa_list_remove(&ep->device_link);
|
||||
ep->device = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
spa_list_for_each(t, &device->transport_list, device_link) {
|
||||
spa_list_for_each_safe(t, tt, &device->transport_list, device_link) {
|
||||
if (t->device == device) {
|
||||
spa_list_remove(&t->device_link);
|
||||
t->device = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue