Commit 6dfe493a authored by alexclarke's avatar alexclarke Committed by Commit bot

Fix unbalanced add/remove task observer

BUG=

Review-Url: https://codereview.chromium.org/2338293002
Cr-Commit-Position: refs/heads/master@{#418814}
parent 781998cc
...@@ -100,11 +100,8 @@ void shutdown() ...@@ -100,11 +100,8 @@ void shutdown()
ThreadState::current()->cleanupMainThread(); ThreadState::current()->cleanupMainThread();
// currentThread() is null if we are running on a thread without a message loop. // currentThread() is null if we are running on a thread without a message loop.
if (Platform::current()->currentThread()) { if (WebThread* currentThread = Platform::current()->currentThread()) {
// We don't need to (cannot) remove s_endOfTaskRunner from the current currentThread->removeTaskObserver(s_endOfTaskRunner);
// message loop, because the message loop is already destructed before
// the shutdown() is called.
delete s_endOfTaskRunner;
s_endOfTaskRunner = nullptr; s_endOfTaskRunner = nullptr;
} }
......
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