summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-04 15:02:03 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-04 15:02:03 +0000
commit4a15d9ee6812dc020855b18afb8c764d0cbab042 (patch)
treeb907264b5a9d5aa015d183a537e9194b25232722 /net/proxy
parent1a9890d1cb7df226211663f1072413f45ddb74f2 (diff)
downloadchromium_src-4a15d9ee6812dc020855b18afb8c764d0cbab042.zip
chromium_src-4a15d9ee6812dc020855b18afb8c764d0cbab042.tar.gz
chromium_src-4a15d9ee6812dc020855b18afb8c764d0cbab042.tar.bz2
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
Diffstat (limited to 'net/proxy')
-rw-r--r--net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc18
1 files changed, 10 insertions, 8 deletions
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<DhcpProxyScriptAdapterFetcher*>::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<DhcpProxyScriptAdapterFetcher*>::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();