summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-08-15 11:23:21 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-08-15 11:23:21 -0700
commitd86dab44ce64d82d56d745e7f21d0c8eb4250496 (patch)
tree85e7728d38fba2dd8991d869a1729c0e9d18abba
parenta0a2f0c6fa125ca3594282f6fdb0e40d8adcbf8b (diff)
parentf4aee7bd601621d648044a0f918247fd81b6190a (diff)
downloadexternal_chromium-d86dab44ce64d82d56d745e7f21d0c8eb4250496.zip
external_chromium-d86dab44ce64d82d56d745e7f21d0c8eb4250496.tar.gz
external_chromium-d86dab44ce64d82d56d745e7f21d0c8eb4250496.tar.bz2
am f4aee7bd: Merge "back port upstream patch"
* commit 'f4aee7bd601621d648044a0f918247fd81b6190a': back port upstream patch
-rw-r--r--base/memory/ref_counted.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h
index 1207ed4..e35264b 100644
--- a/base/memory/ref_counted.h
+++ b/base/memory/ref_counted.h
@@ -260,9 +260,10 @@ class scoped_refptr {
// AddRef first so that self assignment should work
if (p)
p->AddRef();
- if (ptr_ )
- ptr_ ->Release();
+ T* old_ptr = ptr_;
ptr_ = p;
+ if (old_ptr)
+ old_ptr ->Release();
return *this;
}