summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/test
diff options
context:
space:
mode:
authorrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-15 21:29:31 +0000
committerrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-15 21:29:31 +0000
commit42d5e16cdfdab7f954ec8512ae66ab8a416ad25a (patch)
treea14222f66a2dd716562c6712de8b006e739c67fa /chrome/browser/renderer_host/test
parentd84b3729c73df5ca7679bf827a348c97810fc4b3 (diff)
downloadchromium_src-42d5e16cdfdab7f954ec8512ae66ab8a416ad25a.zip
chromium_src-42d5e16cdfdab7f954ec8512ae66ab8a416ad25a.tar.gz
chromium_src-42d5e16cdfdab7f954ec8512ae66ab8a416ad25a.tar.bz2
Fix another memory leak in my unit test.
TEST=none BUG=24769 Review URL: http://codereview.chromium.org/271109 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29191 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/test')
-rw-r--r--chrome/browser/renderer_host/test/site_instance_unittest.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/test/site_instance_unittest.cc b/chrome/browser/renderer_host/test/site_instance_unittest.cc
index 5791ee0..6ee1a59 100644
--- a/chrome/browser/renderer_host/test/site_instance_unittest.cc
+++ b/chrome/browser/renderer_host/test/site_instance_unittest.cc
@@ -468,12 +468,16 @@ TEST_F(SiteInstanceTest, GetSiteInstanceMap) {
scoped_ptr<Profile> p2(new TestingProfile());
scoped_ptr<Profile> p3(new DerivedTestingProfile(p1.get()));
+ // In this test, instances 1 and 2 will be deleted automatically when the
+ // SiteInstance objects they return are deleted. However, instance 3 never
+ // returns any SitesIntance objects in this test, so will not be automatically
+ // deleted. It must be deleted manually.
TestBrowsingInstance* instance1(new TestBrowsingInstance(p1.get(),
&deleteCounter));
TestBrowsingInstance* instance2(new TestBrowsingInstance(p2.get(),
&deleteCounter));
- TestBrowsingInstance* instance3(new TestBrowsingInstance(p3.get(),
- &deleteCounter));
+ scoped_refptr<TestBrowsingInstance> instance3(
+ new TestBrowsingInstance(p3.get(), &deleteCounter));
instance1->use_process_per_site = true;
instance2->use_process_per_site = true;