| Index: device/bluetooth/bluetooth_device_win.cc
|
| diff --git a/device/bluetooth/bluetooth_device_win.cc b/device/bluetooth/bluetooth_device_win.cc
|
| index 561b5a7c6532bb92298f355d70b32c07ca0dec53..363da1d1e02f5a9850e66eadbdcf55f189210146 100644
|
| --- a/device/bluetooth/bluetooth_device_win.cc
|
| +++ b/device/bluetooth/bluetooth_device_win.cc
|
| @@ -43,6 +43,15 @@ BluetoothDeviceWin::BluetoothDeviceWin(
|
| }
|
|
|
| BluetoothDeviceWin::~BluetoothDeviceWin() {
|
| + // Explicitly take and erase GATT services one by one to ensure that calling
|
| + // GetGattService on removed service in GattServiceRemoved returns null.
|
| + std::vector<std::string> service_keys;
|
| + for (const auto& gatt_service : gatt_services_) {
|
| + service_keys.push_back(gatt_service.first);
|
| + }
|
| + for (const auto& key : service_keys) {
|
| + gatt_services_.take_and_erase(key);
|
| + }
|
| }
|
|
|
| uint32_t BluetoothDeviceWin::GetBluetoothClass() const {
|
|
|