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:
@ -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_
|
||||
|
||||
|
Reference in New Issue
Block a user