[webkit-reviews] review denied: [Bug 194178] Leak of NSArray (4.25 Kbytes) in com.apple.WebKit.WebContent running WebKit layout tests on iOS Simulator : [Attachment 360923] Patch v1

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 1 20:21:58 PST 2019


Darin Adler <darin at apple.com> has denied David Kilzer (:ddkilzer)
<ddkilzer at webkit.org>'s request for review:
Bug 194178: Leak of NSArray (4.25 Kbytes) in com.apple.WebKit.WebContent
running WebKit layout tests on iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=194178

Attachment 360923: Patch v1

https://bugs.webkit.org/attachment.cgi?id=360923&action=review




--- Comment #3 from Darin Adler <darin at apple.com> ---
Comment on attachment 360923
  --> https://bugs.webkit.org/attachment.cgi?id=360923
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=360923&action=review

> Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm:163
>      CFArrayRef errors = nullptr;
>     
CTFontManagerUnregisterFontsForURLs(static_cast<CFArrayRef>(fontsToRemove),
kCTFontManagerScopeProcess, &errors);
> +    if (errors) {
> +	   for (id error in (__bridge NSArray *)errors)
> +	       NSLog(@"%@", (__bridge CFErrorRef)error);
> +	   CFRelease(errors);
> +    }

A better fix is to get rid of the "errors" local variable, and pass "nullptr"
instead of "&errors" to CTFontManagerUnregisterFontsForURLs. Then there is no
need for CFRelease. CTFontManagerUnregisterFontsForURLs won't generate an array
of errors if we don’t pass a pointer to a place to put the CFArrayRef.

Also, we should not land that logging code.


More information about the webkit-reviews mailing list