summaryrefslogtreecommitdiffstats
path: root/base/memory
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-09 01:36:23 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-09 01:36:23 +0000
commit7840a7bed8fc223d853932542fcaf4b596cbd772 (patch)
treeda6ba05f3db0a5d1f767d3d17c52325b8cf0a139 /base/memory
parent7ba066c1f553c901b6cff2cabe539fcc906cee3e (diff)
downloadchromium_src-7840a7bed8fc223d853932542fcaf4b596cbd772.zip
chromium_src-7840a7bed8fc223d853932542fcaf4b596cbd772.tar.gz
chromium_src-7840a7bed8fc223d853932542fcaf4b596cbd772.tar.bz2
Break the debug build if a scoped_ptr self-reset is detected.
BUG=162971 Review URL: https://chromiumcodereview.appspot.com/12194034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181583 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/memory')
-rw-r--r--base/memory/scoped_ptr.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/base/memory/scoped_ptr.h b/base/memory/scoped_ptr.h
index d86c249..c6d91df 100644
--- a/base/memory/scoped_ptr.h
+++ b/base/memory/scoped_ptr.h
@@ -239,6 +239,9 @@ class scoped_ptr_impl {
static_cast<D&>(data_)(data_.ptr);
}
data_.ptr = p;
+ } else {
+ // If p is non-NULL, this is a deprecated self-reset.
+ assert(p == NULL);
}
}