| Index: remoting/host/policy_hack/policy_watcher_linux.cc
|
| diff --git a/remoting/host/policy_hack/policy_watcher_linux.cc b/remoting/host/policy_hack/policy_watcher_linux.cc
|
| index 641af9c065cdc07a17450cbb5ae2e3dcd19b992b..f3cffeafb0f0f7a050b8bb1f3085f7d6f4ff0434 100644
|
| --- a/remoting/host/policy_hack/policy_watcher_linux.cc
|
| +++ b/remoting/host/policy_hack/policy_watcher_linux.cc
|
| @@ -51,12 +51,6 @@ class PolicyWatcherLinux : public PolicyWatcher {
|
| : PolicyWatcher(task_runner),
|
| config_dir_(config_dir),
|
| weak_factory_(this) {
|
| - // Detach the factory because we ensure that only the policy thread ever
|
| - // calls methods on this. Also, the API contract of having to call
|
| - // StopWatching() (which signals completion) after StartWatching()
|
| - // before this object can be destructed ensures there are no users of
|
| - // this object before it is destructed.
|
| - weak_factory_.DetachFromThread();
|
| }
|
|
|
| virtual ~PolicyWatcherLinux() {}
|
| @@ -84,8 +78,12 @@ class PolicyWatcherLinux : public PolicyWatcher {
|
|
|
| virtual void StopWatchingInternal() OVERRIDE {
|
| DCHECK(OnPolicyWatcherThread());
|
| - // Cancel any inflight requests.
|
| +
|
| + // Stop watching for changes to files in the policies directory.
|
| watcher_.reset();
|
| +
|
| + // Orphan any pending OnFilePathChanged tasks.
|
| + weak_factory_.InvalidateWeakPtrs();
|
| }
|
|
|
| private:
|
|
|