third_party/skia/src/ports/SkFontHost_mac.cpp: don't increase retain count of
newly assigned CFTypeRef in AutoCFRelease::reset(). Each time CFTypeRef is
assigned to AutoCFRelease, AutoCFRelease becomes its sole owner.
BUG=skia:
R=reed@google.com, bungeman@google.com, rmistry@google.com, sheyang@chromium.org
Author: ljagielski@opera.com
Review URL: https://codereview.chromium.org/
393513003
~AutoCFRelease() { CFSafeRelease(fCFRef); }
void reset(CFRef that = NULL) {
- CFSafeRetain(that);
- CFSafeRelease(fCFRef);
- fCFRef = that;
+ if (that != fCFRef) {
+ CFSafeRelease(fCFRef);
+ fCFRef = that;
+ }
}
AutoCFRelease& operator =(CFRef that) {