| Index: device/gamepad/gamepad_provider.cc
|
| diff --git a/device/gamepad/gamepad_provider.cc b/device/gamepad/gamepad_provider.cc
|
| index d5dd358702c74bcdb42ada0696cce0fd2a56f6d3..701e0a41f073a1131bd2dfa13cbad0bccc564598 100644
|
| --- a/device/gamepad/gamepad_provider.cc
|
| +++ b/device/gamepad/gamepad_provider.cc
|
| @@ -72,9 +72,18 @@ GamepadProvider::~GamepadProvider() {
|
| if (monitor)
|
| monitor->RemoveDevicesChangedObserver(this);
|
|
|
| + // Delete GamepadDataFetchers on |polling_thread_|. This is important because
|
| + // some of them require their destructor to be called on the same sequence as
|
| + // their other methods.
|
| + polling_thread_->task_runner()->PostTask(
|
| + FROM_HERE, base::Bind(&GamepadFetcherVector::clear,
|
| + base::Unretained(&data_fetchers_)));
|
| +
|
| // Use Stop() to join the polling thread, as there may be pending callbacks
|
| // which dereference |polling_thread_|.
|
| polling_thread_->Stop();
|
| +
|
| + DCHECK(data_fetchers_.empty());
|
| }
|
|
|
| base::SharedMemoryHandle GamepadProvider::GetSharedMemoryHandleForProcess(
|
|
|