summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents/site_instance.cc
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-07 23:39:47 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-07 23:39:47 +0000
commit633fbc48fd3d76d4b862120778f87c0794ef5c61 (patch)
tree3088d14d6755693f195fc041aef270d2eaf015cb /chrome/browser/tab_contents/site_instance.cc
parent4a8bca5ce3b7c77514f3a46625c0ac397848b15b (diff)
downloadchromium_src-633fbc48fd3d76d4b862120778f87c0794ef5c61.zip
chromium_src-633fbc48fd3d76d4b862120778f87c0794ef5c61.tar.gz
chromium_src-633fbc48fd3d76d4b862120778f87c0794ef5c61.tar.bz2
Fix memory leak in SiteInstance::CreateSiteInstanceForURL.
TBR=creis Review URL: http://codereview.chromium.org/115110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15596 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/site_instance.cc')
-rw-r--r--chrome/browser/tab_contents/site_instance.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/site_instance.cc b/chrome/browser/tab_contents/site_instance.cc
index e817b8b..346283f 100644
--- a/chrome/browser/tab_contents/site_instance.cc
+++ b/chrome/browser/tab_contents/site_instance.cc
@@ -96,7 +96,10 @@ SiteInstance* SiteInstance::CreateSiteInstance(Profile* profile) {
/*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*/