summaryrefslogtreecommitdiffstats
path: root/base/scoped_cftyperef.h
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 20:57:05 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 20:57:05 +0000
commit42ea87098d2fd5dd54d87043746ff9b4b93d47a3 (patch)
tree925a158b6387cf4e1815b94cea1763ad8e8bc151 /base/scoped_cftyperef.h
parent1b5753a6785ee2caf6bbf417d4b8d6ec9a9ef9a4 (diff)
downloadchromium_src-42ea87098d2fd5dd54d87043746ff9b4b93d47a3.zip
chromium_src-42ea87098d2fd5dd54d87043746ff9b4b93d47a3.tar.gz
chromium_src-42ea87098d2fd5dd54d87043746ff9b4b93d47a3.tar.bz2
Fix scoped_cftyperef<>::reset() to adopt the incoming CFTypeRef when the
existing stored pointer is NULL. Review URL: http://codereview.chromium.org/9130 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/scoped_cftyperef.h')
-rw-r--r--base/scoped_cftyperef.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/base/scoped_cftyperef.h b/base/scoped_cftyperef.h
index 0b4cb8c..2e8d400 100644
--- a/base/scoped_cftyperef.h
+++ b/base/scoped_cftyperef.h
@@ -27,8 +27,9 @@ class scoped_cftyperef {
}
void reset(CFT object = NULL) {
- if (object_ && object_ != object) {
- CFRelease(object_);
+ if (object_ != object) {
+ if (object_)
+ CFRelease(object_);
object_ = object;
}
}
@@ -71,4 +72,3 @@ class scoped_cftyperef {
};
#endif // BASE_SCOPED_CFTYPEREF_H_
-