diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-22 21:25:21 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-22 21:25:21 +0000 |
commit | f4f4a4251386f79b27ef32855cfe7f2e373dcb2c (patch) | |
tree | 1cad37b4577d0597a6dd317847305acc292ee122 /cloud_print | |
parent | 9e01c9efdb9acb241097df301d3154e1884e024d (diff) | |
download | chromium_src-f4f4a4251386f79b27ef32855cfe7f2e373dcb2c.zip chromium_src-f4f4a4251386f79b27ef32855cfe7f2e373dcb2c.tar.gz chromium_src-f4f4a4251386f79b27ef32855cfe7f2e373dcb2c.tar.bz2 |
Update scoped_ptr<T>::reset() to more closely match std::unique_ptr<T>.
Remove the no-op behavior of a scoped_ptr "self-reset", and update the
reset() method to detect problematic dependencies on the sequence of
events. Eventually, reset() will be updated to exactly match the
implementation of std::unique_ptr<T> by setting data_.ptr to the new
value before deleting the old value.
However, this will expose latent bugs where a destructor invoked
transitively by reset() attempts to dereference the same scoped_ptr.
Relying on the value of get() in this instance will dispatch calls to
the incorrect object. As a temporary measure to detect this class of
bugs, set data_.ptr to NULL during deletion so that it results in a
crash.
BUG=162971,176091
Review URL: https://codereview.chromium.org/12223113
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print')
0 files changed, 0 insertions, 0 deletions