0

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
This commit is contained in:
mark@chromium.org
2008-11-04 20:57:05 +00:00
parent 1b5753a678
commit 42ea87098d

@ -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_