From d1844db20ae4e5d43986ed0bccedad3924b850a1 Mon Sep 17 00:00:00 2001 From: Brad Werth Date: Mon, 9 Nov 2020 20:38:11 +0000 Subject: [PATCH] Bug 1675854 Part 2: Use AutoRelease in ScaledFontMac::GetFontDescriptor. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D96456 --- gfx/2d/ScaledFontMac.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gfx/2d/ScaledFontMac.cpp b/gfx/2d/ScaledFontMac.cpp index f04d93b4ed30..3379656fb37e 100644 --- a/gfx/2d/ScaledFontMac.cpp +++ b/gfx/2d/ScaledFontMac.cpp @@ -374,7 +374,7 @@ bool UnscaledFontMac::GetFontDescriptor(FontDescriptorOutput aCb, return false; } - CFStringRef psname = CGFontCopyPostScriptName(mFont); + AutoRelease psname(CGFontCopyPostScriptName(mFont)); if (!psname) { return false; } @@ -383,14 +383,12 @@ bool UnscaledFontMac::GetFontDescriptor(FontDescriptorOutput aCb, const char* cstr = CFStringGetCStringPtr(psname, kCFStringEncodingUTF8); if (!cstr) { if (!CFStringGetCString(psname, buf, sizeof(buf), kCFStringEncodingUTF8)) { - CFRelease(psname); return false; } cstr = buf; } aCb(reinterpret_cast(cstr), strlen(cstr), 0, aBaton); - CFRelease(psname); return true; } -- 2.11.4.GIT