summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-01 10:06:45 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-01 10:06:45 +0000
commit72caffa4490b52d33aef07365a5e87cd96cdcbf3 (patch)
tree4c0d4fb3ce1597c1e6ce27b02ec01dbe3721e2db
parent4ea86195ed973835a5078b8a31498b056977c3d2 (diff)
downloadchromium_src-72caffa4490b52d33aef07365a5e87cd96cdcbf3.zip
chromium_src-72caffa4490b52d33aef07365a5e87cd96cdcbf3.tar.gz
chromium_src-72caffa4490b52d33aef07365a5e87cd96cdcbf3.tar.bz2
Fix memory leak introuced by crrev.com/103153.
BUG=98538 TEST= Review URL: http://codereview.chromium.org/8083022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103635 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_settings_storage_unittest.cc8
-rw-r--r--chrome/browser/extensions/extension_settings_storage_unittest.h3
-rw-r--r--tools/heapcheck/suppressions.txt6
-rw-r--r--tools/valgrind/memcheck/suppressions.txt6
4 files changed, 8 insertions, 15 deletions
diff --git a/chrome/browser/extensions/extension_settings_storage_unittest.cc b/chrome/browser/extensions/extension_settings_storage_unittest.cc
index 5e4e5a2..1207be0 100644
--- a/chrome/browser/extensions/extension_settings_storage_unittest.cc
+++ b/chrome/browser/extensions/extension_settings_storage_unittest.cc
@@ -79,8 +79,12 @@ ExtensionSettingsStorageTest::~ExtensionSettingsStorageTest() {}
void ExtensionSettingsStorageTest::SetUp() {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- storage_ = (GetParam())(temp_dir_.path(), "fakeExtension");
- ASSERT_TRUE(storage_ != NULL);
+ storage_.reset((GetParam())(temp_dir_.path(), "fakeExtension"));
+ ASSERT_TRUE(storage_.get());
+}
+
+void ExtensionSettingsStorageTest::TearDown() {
+ storage_.reset();
}
TEST_P(ExtensionSettingsStorageTest, GetWhenEmpty) {
diff --git a/chrome/browser/extensions/extension_settings_storage_unittest.h b/chrome/browser/extensions/extension_settings_storage_unittest.h
index 51877ce..b356bbd 100644
--- a/chrome/browser/extensions/extension_settings_storage_unittest.h
+++ b/chrome/browser/extensions/extension_settings_storage_unittest.h
@@ -30,9 +30,10 @@ class ExtensionSettingsStorageTest
virtual ~ExtensionSettingsStorageTest();
virtual void SetUp() OVERRIDE;
+ virtual void TearDown() OVERRIDE;
protected:
- ExtensionSettingsStorage* storage_;
+ scoped_ptr<ExtensionSettingsStorage> storage_;
std::string key1_;
std::string key2_;
diff --git a/tools/heapcheck/suppressions.txt b/tools/heapcheck/suppressions.txt
index d80e1d2..de382db 100644
--- a/tools/heapcheck/suppressions.txt
+++ b/tools/heapcheck/suppressions.txt
@@ -1636,12 +1636,6 @@
fun:ExtensionContentSettingsStoreTest_*
}
{
- bug_98538
- Heapcheck:Leak
- ...
- fun:ExtensionSettingsStorageTest*
-}
-{
bug_98568
Heapcheck:Leak
...
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index e9dd469..cae84c6 100644
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -4609,12 +4609,6 @@
fun:avcodec_decode_audio3
}
{
- bug_98538
- Memcheck:Leak
- ...
- fun:*ExtensionSettingsStorageTest*
-}
-{
bug_98568
Memcheck:Leak
...