[webkit-reviews] review denied: [Bug 176236] Add a ResourceBundle abstraction : [Attachment 449612] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 20 15:25:42 PST 2022


Darin Adler <darin at apple.com> has denied  review:
Bug 176236: Add a ResourceBundle abstraction
https://bugs.webkit.org/show_bug.cgi?id=176236

Attachment 449612: Patch

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




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

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

> Source/WTF/wtf/cf/ResourceBundleCF.cpp:73
> +    RetainPtr<CFURLRef> requestedURLRef =
CFBundleCopyResourceURL(m_bundle.get(), name.createCFString().get(),
type.createCFString().get(), directory.createCFString().get());

This will leak the URL. Needs to use adoptCF:

    auto requestedURL = adoptCF(CFBundleCopyResourceURL(m_bundle.get(),
name.createCFString().get(), type.createCFString().get(),
directory.createCFString().get()));

> Source/WTF/wtf/cf/ResourceBundleCF.cpp:88
> +    return URL(CFBundleCopyResourceURL(m_bundle.get(),
name.createCFString().get(), type.createCFString().get(),
directory.createCFString().get()));

Same problem here, calling CFBundleCopyResourceURL without adoptCF will lead to
a leak.


More information about the webkit-reviews mailing list