Commit 8c08f77e authored by dnicoara's avatar dnicoara Committed by Commit bot

[Ozone-Drm] Do not try to take ref_ptr from destructor

Can't post a task with a ref-counted instance of the watcher from the
destructor.

BUG=467170

Review URL: https://codereview.chromium.org/1006403002

Cr-Commit-Position: refs/heads/master@{#320739}
parent fee69b4b
...@@ -114,6 +114,7 @@ class DrmDevice::IOWatcher ...@@ -114,6 +114,7 @@ class DrmDevice::IOWatcher
base::WaitableEvent done(false, false); base::WaitableEvent done(false, false);
io_task_runner_->PostTask( io_task_runner_->PostTask(
FROM_HERE, base::Bind(&IOWatcher::SetPausedOnIO, this, &done)); FROM_HERE, base::Bind(&IOWatcher::SetPausedOnIO, this, &done));
done.Wait();
} }
void Shutdown() { void Shutdown() {
...@@ -125,7 +126,7 @@ class DrmDevice::IOWatcher ...@@ -125,7 +126,7 @@ class DrmDevice::IOWatcher
private: private:
friend class base::RefCountedThreadSafe<IOWatcher>; friend class base::RefCountedThreadSafe<IOWatcher>;
~IOWatcher() override { SetPaused(true); } ~IOWatcher() override {}
void RegisterOnIO() { void RegisterOnIO() {
DCHECK(base::MessageLoopForIO::IsCurrent()); DCHECK(base::MessageLoopForIO::IsCurrent());
......
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