Commit 80a8584a authored by jameshollyer's avatar jameshollyer Committed by Commit Bot

Only call DiscoveryStopped once when discovery stops

The call to BluetoothTaskManagerWin::DiscoverDevices runs on a loop
until either discovery stops or we find the device we are searching for.
If discovery stops this function called
BluetoothTaskManagerWin::OnStopDiscovery.  However, we call
BluetoothTaskManagerWin::OnStopDiscovery already when we stop. The
second call causes a crash. This CL removes that call.

Bug: 1022149
Change-Id: I74d977abdfd69cbde2e525a024b1f6016148ed7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1915300Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715843}
parent c21469c8
......@@ -455,12 +455,8 @@ void BluetoothTaskManagerWin::StopDiscovery() {
void BluetoothTaskManagerWin::DiscoverDevices(int timeout_multiplier) {
DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
if (!discovering_ || !classic_wrapper_->HasHandle()) {
ui_task_runner_->PostTask(
FROM_HERE,
base::BindOnce(&BluetoothTaskManagerWin::OnDiscoveryStopped, this));
if (!discovering_ || !classic_wrapper_->HasHandle())
return;
}
std::vector<std::unique_ptr<DeviceState>> device_list;
if (SearchDevices(timeout_multiplier, false, &device_list)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment