bluez5: fix reference to already freed spa_bt_device

Fixes #907
This commit is contained in:
Huang-Huang Bao 2021-03-18 07:00:06 +08:00
parent 529f4d318f
commit 68677774fc
No known key found for this signature in database
GPG key ID: 33C3271387A13D1B
2 changed files with 17 additions and 17 deletions

View file

@ -757,6 +757,7 @@ static int device_connected_old(struct spa_bt_monitor *monitor, struct spa_bt_de
info.props = &SPA_DICT_INIT(items, n_items);
spa_device_emit_object_info(&monitor->hooks, device->id, &info);
} else {
device->added = false;
battery_remove(device);
spa_bt_device_release_transports(device);
spa_device_emit_object_info(&monitor->hooks, device->id, NULL);
@ -833,10 +834,6 @@ static int device_connected(struct spa_bt_monitor *monitor, struct spa_bt_device
info.props = &SPA_DICT_INIT(items, n_items);
spa_device_emit_object_info(&monitor->hooks, device->id, &info);
if(!init && !device->connected) {
spa_device_emit_object_info(&monitor->hooks, device->id, NULL);
}
return 0;
}