diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-27 17:51:36 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-27 17:51:36 +0000 |
commit | 1bba17e11ffd134c660246560952d63f7c7e415b (patch) | |
tree | 186a347af82ac221f6a1f69271122719f4e785ea | |
parent | 61899d3915693df7dbc8c5bdaa6e8ae4ba3931d0 (diff) | |
download | chromium_src-1bba17e11ffd134c660246560952d63f7c7e415b.zip chromium_src-1bba17e11ffd134c660246560952d63f7c7e415b.tar.gz chromium_src-1bba17e11ffd134c660246560952d63f7c7e415b.tar.bz2 |
Fix a memory leak in release with ThreadCollisionWarner unit tests. Less than ideal #ifdef's.
Review URL: http://codereview.chromium.org/19018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8724 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/thread_collision_warner_unittest.cc | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/base/thread_collision_warner_unittest.cc b/base/thread_collision_warner_unittest.cc index 93a74e5..69e85f0 100644 --- a/base/thread_collision_warner_unittest.cc +++ b/base/thread_collision_warner_unittest.cc @@ -114,9 +114,12 @@ TEST(ThreadCollisionTest, MTBookCriticalSectionTest) { public: explicit NonThreadSafeQueue(base::AsserterBase* asserter) #if !defined(NDEBUG) - : push_pop_(asserter) + : push_pop_(asserter) { +#else + { + delete asserter; #endif - { } + } void push(int value) { DFAKE_SCOPED_LOCK_THREAD_LOCKED(push_pop_); @@ -177,9 +180,12 @@ TEST(ThreadCollisionTest, MTScopedBookCriticalSectionTest) { public: explicit NonThreadSafeQueue(base::AsserterBase* asserter) #if !defined(NDEBUG) - : push_pop_(asserter) + : push_pop_(asserter) { +#else + { + delete asserter; #endif - { } + } void push(int value) { DFAKE_SCOPED_LOCK(push_pop_); @@ -241,9 +247,12 @@ TEST(ThreadCollisionTest, MTSynchedScopedBookCriticalSectionTest) { public: explicit NonThreadSafeQueue(base::AsserterBase* asserter) #if !defined(NDEBUG) - : push_pop_(asserter) + : push_pop_(asserter) { +#else + { + delete asserter; #endif - { } + } void push(int value) { DFAKE_SCOPED_LOCK(push_pop_); @@ -312,9 +321,12 @@ TEST(ThreadCollisionTest, MTSynchedScopedRecursiveBookCriticalSectionTest) { public: explicit NonThreadSafeQueue(base::AsserterBase* asserter) #if !defined(NDEBUG) - : push_pop_(asserter) + : push_pop_(asserter) { +#else + { + delete asserter; #endif - { } + } void push(int) { DFAKE_SCOPED_RECURSIVE_LOCK(push_pop_); |