WebKit Bugzilla
Attachment 362303 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 v2
bug-194761-20190218105001.patch (text/plain), 3.21 KB, created by
David Kilzer (:ddkilzer)
on 2019-02-18 10:50:01 PST
(
hide
)
Description:
Patch v2
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2019-02-18 10:50:01 PST
Size:
3.21 KB
patch
obsolete
>Subversion Revision: 241649 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 7fa03181a2306e134a0e17fc9dece45dd06e7f40..3b95c3ec357ac96cd20f737624440edfd6f333dd 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,18 @@ >+2019-02-18 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. 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..86ea6fdc3b9464652727cf0ce2bbfb0b072ca2d1 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,10 @@ 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)) { >+ NSLog(@"Failed to activate fake Helvetica: %@", error); >+ 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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194761
:
362234
|
362303
|
362389