Index: third_party/WebKit/Source/web/WebKit.cpp |
diff --git a/third_party/WebKit/Source/web/WebKit.cpp b/third_party/WebKit/Source/web/WebKit.cpp |
index ec5d97a01e9791f640ff3d6863e8a64f6108864d..af4f7aaa89ad532935a288e1c2e32f416b7b1882 100644 |
--- a/third_party/WebKit/Source/web/WebKit.cpp |
+++ b/third_party/WebKit/Source/web/WebKit.cpp |
@@ -100,11 +100,8 @@ void shutdown() |
ThreadState::current()->cleanupMainThread(); |
// currentThread() is null if we are running on a thread without a message loop. |
- if (Platform::current()->currentThread()) { |
- // We don't need to (cannot) remove s_endOfTaskRunner from the current |
- // message loop, because the message loop is already destructed before |
- // the shutdown() is called. |
- delete s_endOfTaskRunner; |
+ if (WebThread* currentThread = Platform::current()->currentThread()) { |
+ currentThread->removeTaskObserver(s_endOfTaskRunner); |
s_endOfTaskRunner = nullptr; |
} |