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

Unified Diff: chrome/browser/tab_contents/background_contents.cc

Issue 13871010: Explicitly free the web contents in the background contents destructor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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: chrome/browser/tab_contents/background_contents.cc
diff --git a/chrome/browser/tab_contents/background_contents.cc b/chrome/browser/tab_contents/background_contents.cc
index 5f40758efdcf1212aec1f90ee2b56471adb5ad4a..3f8b589e2ae19e68a9a5d56ff05fb00be7c01b8e 100644
--- a/chrome/browser/tab_contents/background_contents.cc
+++ b/chrome/browser/tab_contents/background_contents.cc
@@ -61,6 +61,11 @@ BackgroundContents::~BackgroundContents() {
chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED,
content::Source<Profile>(profile_),
content::Details<BackgroundContents>(this));
+ // Manually clear web_contents_ to try to track down http://crbug.com/164617.
+ // Freeing the WebContents can cause the RenderViewHost to be destroyed, so
+ // we need to do this after sending out BACKGROUND_CONTENTS_DELETED to give
+ // things like the TaskManager a chance to clean up their references first.
+ web_contents_.reset();
}
const GURL& BackgroundContents::GetURL() const {
« 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