diff options
author | earthdok@google.com <earthdok@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-07 14:32:23 +0000 |
---|---|---|
committer | earthdok@google.com <earthdok@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-07 14:32:23 +0000 |
commit | 4a35865d0eefbb69dfa61649110952c6c754aa58 (patch) | |
tree | 3fdce377f835967ecd8847d50b071b0a196dac3f /base | |
parent | bd59ee9255aa8fde7c5b03ddbbb39a7daf5215a5 (diff) | |
download | chromium_src-4a35865d0eefbb69dfa61649110952c6c754aa58.zip chromium_src-4a35865d0eefbb69dfa61649110952c6c754aa58.tar.gz chromium_src-4a35865d0eefbb69dfa61649110952c6c754aa58.tar.bz2 |
Annotate the intentional leak in weak_ptr_unittest.cc.
Remove the corresponding suppressions.
BUG=179758
R=akalin@chromium.org,darin@chromium.org
CC=glider@chromium.org
Review URL: https://chromiumcodereview.appspot.com/15848016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/memory/weak_ptr_unittest.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/base/memory/weak_ptr_unittest.cc b/base/memory/weak_ptr_unittest.cc index 8cf020a..0a2724c 100644 --- a/base/memory/weak_ptr_unittest.cc +++ b/base/memory/weak_ptr_unittest.cc @@ -7,6 +7,7 @@ #include <string> #include "base/bind.h" +#include "base/debug/leak_annotations.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "base/synchronization/waitable_event.h" @@ -435,9 +436,12 @@ TEST(WeakPtrTest, NonOwnerThreadCanCopyAndAssignWeakPtr) { // Main thread creates a Target object. Target target; // Main thread creates an arrow referencing the Target. - Arrow* arrow = new Arrow(); - arrow->target = target.AsWeakPtr(); - + Arrow *arrow; + { + ANNOTATE_SCOPED_MEMORY_LEAK; + arrow = new Arrow(); + arrow->target = target.AsWeakPtr(); + } // Background can copy and assign arrow (as well as the WeakPtr inside). BackgroundThread background; background.Start(); @@ -448,9 +452,12 @@ TEST(WeakPtrTest, NonOwnerThreadCanCopyAndAssignWeakPtrBase) { // Main thread creates a Target object. Target target; // Main thread creates an arrow referencing the Target. - Arrow* arrow = new Arrow(); - arrow->target = target.AsWeakPtr(); - + Arrow *arrow; + { + ANNOTATE_SCOPED_MEMORY_LEAK; + arrow = new Arrow(); + arrow->target = target.AsWeakPtr(); + } // Background can copy and assign arrow's WeakPtr to a base class WeakPtr. BackgroundThread background; background.Start(); |