0

Fix memory leak when simulating failures in unit tests.

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
rvargas@google.com
2008-07-30 23:24:04 +00:00
parent 6e79bdd62a
commit b6eea42d4b

@ -1040,7 +1040,9 @@ void BackendImpl::RestartCache() {
// Don't call Init() if directed by the unit test: we are simulating a failure
// trying to re-enable the cache.
if (!unit_test_ && Init())
if (unit_test_)
init_ = true; // Let the destructor do proper cleanup.
else if (Init())
stats_.SetCounter(Stats::FATAL_ERROR, errors + 1);
}