WebKit Bugzilla
Attachment 362389 Details for
Bug 194761
: Leak of CFErrorRef objects (1.92 Kbytes) in com.apple.WebKit.WebContent.Development running WebKit layout tests on iOS Simulator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v3
bug-194761-20190219100308.patch (text/plain), 3.45 KB, created by
David Kilzer (:ddkilzer)
on 2019-02-19 10:03:09 PST
(
hide
)
Description:
Patch v3
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2019-02-19 10:03:09 PST
Size:
3.45 KB
patch
obsolete
>Subversion Revision: 241649 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 7fa03181a2306e134a0e17fc9dece45dd06e7f40..7869fed38277a6a239da9e82af96ff71ef6ad6eb 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,19 @@ >+2019-02-19 David Kilzer <ddkilzer@apple.com> >+ >+ Leak of CFErrorRef objects (1.92 Kbytes) in com.apple.WebKit.WebContent.Development running WebKit layout tests on iOS Simulator >+ <https://webkit.org/b/194761> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: >+ (WTR::activateSystemCoreWebFonts): Log `error` to console if >+ CTFontManagerRegisterFontsForURL() fails (macOS only). >+ (WTR::activateFonts): Change `0` to `nullptr`. >+ (WTR::installFakeHelvetica): Log `error` to console if >+ CTFontManagerRegisterFontsForURL() fails, but only on supported >+ platforms (macOS Mojave and newer). Call CFRelease() on `error` >+ to fix the leak. >+ > 2018-12-10 David Kilzer <ddkilzer@apple.com> > > run-webkit-tests --leaks should run `leaks` on all com.apple.WebKit.* processes >diff --git a/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm b/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm >index 3d6adf623f7a26652c6ad4819bd1317f608bacca..ac7890409e01a57763570df56403ad443a9d9209 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm >+++ b/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm >@@ -88,7 +88,11 @@ static void activateSystemCoreWebFonts() > // also activates e.g. Arial Unicode, which is not a variation of Arial. > for (NSString *coreWebFontName in coreWebFontNames) { > if ([fileName hasPrefix:coreWebFontName]) { >- CTFontManagerRegisterFontsForURL((CFURLRef)fontURL, kCTFontManagerScopeProcess, 0); >+ CFErrorRef error = nullptr; >+ if (!CTFontManagerRegisterFontsForURL((CFURLRef)fontURL, kCTFontManagerScopeProcess, &error)) { >+ NSLog(@"Failed to activate %@: %@", coreWebFontName, error); >+ CFRelease(error); >+ } > break; > } > } >@@ -121,7 +125,7 @@ void activateFonts() > [fontURLs addObject:[fontURL absoluteURL]]; > } > >- CFArrayRef errors = 0; >+ CFArrayRef errors = nullptr; > if (!CTFontManagerRegisterFontsForURLs((CFArrayRef)fontURLs, kCTFontManagerScopeProcess, &errors)) { > NSLog(@"Failed to activate fonts: %@", errors); > CFRelease(errors); >@@ -138,7 +142,13 @@ void installFakeHelvetica(WKStringRef configuration) > RetainPtr<CFStringRef> configurationString = adoptCF(WKStringCopyCFString(kCFAllocatorDefault, configuration)); > NSURL *resourceURL = [resourcesDirectoryURL() URLByAppendingPathComponent:[NSString stringWithFormat:@"FakeHelvetica-%@.ttf", configurationString.get()] isDirectory:NO]; > CFErrorRef error = nullptr; >- CTFontManagerRegisterFontsForURL(static_cast<CFURLRef>(resourceURL), kCTFontManagerScopeProcess, &error); >+ if (!CTFontManagerRegisterFontsForURL(static_cast<CFURLRef>(resourceURL), kCTFontManagerScopeProcess, &error)) { >+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ // Registering shadow fonts is only supported on macOS Mojave or newer. See Bugs 180062 & 194761. >+ NSLog(@"Failed to activate fake Helvetica: %@", error); >+#endif >+ CFRelease(error); >+ } > } > > void uninstallFakeHelvetica()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mmaxfield
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194761
:
362234
|
362303
| 362389