Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: content/renderer/image_downloader/image_downloader_impl.cc

Issue 2286603002: Forbid ImageDownloaderImpl from accessing RenderThread instance after message loop shutdown. (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/image_downloader/image_downloader_impl.cc
diff --git a/content/renderer/image_downloader/image_downloader_impl.cc b/content/renderer/image_downloader/image_downloader_impl.cc
index ac4995a2fec9d3343a410706ee1635a4c103f67d..31e9c51fd271c588ec34db957b8f2e4f78d585ea 100644
--- a/content/renderer/image_downloader/image_downloader_impl.cc
+++ b/content/renderer/image_downloader/image_downloader_impl.cc
@@ -130,7 +130,9 @@ ImageDownloaderImpl::ImageDownloaderImpl(
}
ImageDownloaderImpl::~ImageDownloaderImpl() {
- RenderThread::Get()->RemoveObserver(this);
+ RenderThread* thread = RenderThread::Get();
+ if (thread)
yzshen1 2016/08/26 19:20:31 Please comment on why this null check is necessary
leonhsl(Using Gerrit) 2016/08/29 02:17:30 Done and thanks.
+ thread->RemoveObserver(this);
}
// static
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698