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

Unified Diff: content/child/child_process.cc

Issue 2309153002: Remove RenderThreadImpl::Shutdown (Closed)
Patch Set: temp Created 3 years, 11 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
Index: content/child/child_process.cc
diff --git a/content/child/child_process.cc b/content/child/child_process.cc
index 2763ee03cffdb0b12d5934091b9c31f7bad6ff39..7c5b408e842e328c5f0b8c2edc1abe0beb91a41b 100644
--- a/content/child/child_process.cc
+++ b/content/child/child_process.cc
@@ -67,11 +67,15 @@ ChildProcess::~ChildProcess() {
// notice shutdown before the render process begins waiting for them to exit.
shutdown_event_.Signal();
- // Kill the main thread object before nulling child_process, since
- // destruction code might depend on it.
if (main_thread_) { // null in unittests.
main_thread_->Shutdown();
- main_thread_.reset();
+ if (main_thread_->ShouldBeDestroyed()) {
+ main_thread_.reset();
+ } else {
+ // Leak the main_thread_. See a comment in
+ // RenderThreadImpl::ShouldBeDestroyed.
+ main_thread_.release();
+ }
}
g_lazy_tls.Pointer()->Set(NULL);

Powered by Google App Engine
This is Rietveld 408576698