Guard discovery callbacks with a lock.

This commit is contained in:
Vibhav Pant
2023-09-09 13:44:27 +05:30
parent 386d27d646
commit d1659d2231
2 changed files with 27 additions and 13 deletions
@@ -159,7 +159,7 @@ void MonitoredBluetoothDevice::onPropertiesChanged(
observer->DeviceConnectedStateChanged(*this, it->second);
}
} else if (it->first == bluez::DEVICE_NAME) {
auto callback = discovery_cb_.lock();
auto callback = GetDiscoveryCallback();
if (callback != nullptr && callback->device_name_changed_cb != nullptr)
callback->device_name_changed_cb(*this);
}