From 4a15d9ee6812dc020855b18afb8c764d0cbab042 Mon Sep 17 00:00:00 2001 From: "joi@chromium.org" Date: Mon, 4 Jul 2011 15:02:03 +0000 Subject: Fix ReuseTest memory handling. BUG=87616 TEST=net_unittests Review URL: http://codereview.chromium.org/7290011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91473 0039d316-1c4b-4281-b951-d872f2087c98 --- net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'net/proxy') diff --git a/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc b/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc index baa3f26..fe103b7 100644 --- a/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc +++ b/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc @@ -303,14 +303,7 @@ class MockDhcpProxyScriptFetcherWin : public DhcpProxyScriptFetcherWin { } virtual ~MockDhcpProxyScriptFetcherWin() { - // Delete any adapter fetcher objects we didn't hand out. - std::vector::const_iterator it - = adapter_fetchers_.begin(); - for (; it != adapter_fetchers_.end(); ++it) { - if (num_fetchers_created_-- <= 0) { - delete (*it); - } - } + ResetTestState(); } // Adds a fetcher object to the queue of fetchers used by @@ -350,6 +343,15 @@ class MockDhcpProxyScriptFetcherWin : public DhcpProxyScriptFetcherWin { } void ResetTestState() { + // Delete any adapter fetcher objects we didn't hand out. + std::vector::const_iterator it + = adapter_fetchers_.begin(); + for (; it != adapter_fetchers_.end(); ++it) { + if (num_fetchers_created_-- <= 0) { + delete (*it); + } + } + next_adapter_fetcher_index_ = 0; num_fetchers_created_ = 0; adapter_fetchers_.clear(); -- cgit v1.1