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

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

Issue 115110: Fix memory leak in SiteInstance::CreateSiteInstanceForURL. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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/site_instance.cc
===================================================================
--- chrome/browser/tab_contents/site_instance.cc (revision 15565)
+++ chrome/browser/tab_contents/site_instance.cc (working copy)
@@ -96,7 +96,10 @@
/*static*/
SiteInstance* SiteInstance::CreateSiteInstanceForURL(Profile* profile,
const GURL& url) {
- return (new BrowsingInstance(profile))->GetSiteInstanceForURL(url);
+ // This BrowsingInstance may be deleted if it returns an existing
+ // SiteInstance.
+ scoped_refptr<BrowsingInstance> instance(new BrowsingInstance(profile));
+ return instance->GetSiteInstanceForURL(url);
}
/*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