From f92caf26c7dfb54fa072082b6129d57e1a050a2f Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Thu, 29 Oct 2009 01:14:03 +0000 Subject: Call Release instead of deleteing the object directly. BUG=25354 TBR=nsylvain Review URL: http://codereview.chromium.org/341027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30414 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/dom_ui/new_tab_ui.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'chrome/browser') diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index 5f50603..6071a2b 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -578,8 +578,10 @@ NewTabUI::NewTabUI(TabContents* contents) &chrome_url_data_manager, &ChromeURLDataManager::AddDataSource, html_source)); - if (!posted) - delete html_source; // Keep Valgrind happy in tests. + if (!posted) { + html_source->AddRef(); + html_source->Release(); // Keep Valgrind happy in tests. + } } // Listen for theme installation. @@ -623,8 +625,10 @@ void NewTabUI::InitializeCSSCaches() { &chrome_url_data_manager, &ChromeURLDataManager::AddDataSource, theme)); - if (!posted) - delete theme; // Keep Valgrind happy in tests. + if (!posted) { + theme->AddRef(); + theme->Release(); // Keep Valgrind happy in tests. + } } // static -- cgit v1.1