Index: device/bluetooth/bluetooth_device.cc |
diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc |
index 7d37591f5ea21483e15af7ab315436d3e8a6e70e..fa4322fcc17536f850ae286770d133e7585a904f 100644 |
--- a/device/bluetooth/bluetooth_device.cc |
+++ b/device/bluetooth/bluetooth_device.cc |
@@ -26,7 +26,9 @@ BluetoothDevice::BluetoothDevice(BluetoothAdapter* adapter) |
services_data_(new base::DictionaryValue()) {} |
BluetoothDevice::~BluetoothDevice() { |
- DidDisconnectGatt(); |
+ for (BluetoothGattConnection* connection : gatt_connections_) { |
+ connection->InvalidateConnectionReference(); |
+ } |
} |
BluetoothDevice::ConnectionInfo::ConnectionInfo() |
@@ -335,6 +337,7 @@ void BluetoothDevice::DidConnectGatt() { |
} |
create_gatt_connection_success_callbacks_.clear(); |
create_gatt_connection_error_callbacks_.clear(); |
+ GetAdapter()->NotifyDeviceChanged(this); |
} |
void BluetoothDevice::DidFailToConnectGatt(ConnectErrorCode error) { |
@@ -358,6 +361,7 @@ void BluetoothDevice::DidDisconnectGatt() { |
connection->InvalidateConnectionReference(); |
} |
gatt_connections_.clear(); |
+ GetAdapter()->NotifyDeviceChanged(this); |
} |
void BluetoothDevice::AddGattConnection(BluetoothGattConnection* connection) { |