Bug 201893 - REGRESSION (r247566): Leak of UICTFontDescriptor in WebCore::FontDatabase::InstalledFont::InstalledFont()
Summary: REGRESSION (r247566): Leak of UICTFontDescriptor in WebCore::FontDatabase::In...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
Keywords: InRadar
Depends on:
Reported: 2019-09-17 19:46 PDT by David Kilzer (:ddkilzer)
Modified: 2019-09-18 04:30 PDT (History)
6 users (show)

See Also:

Patch v1 (1.73 KB, patch)
2019-09-17 19:52 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2019-09-17 19:46:39 PDT
Leak of UICTFontDescriptor in WebCore::FontDatabase::InstalledFont::InstalledFont():

    struct InstalledFont {
        InstalledFont() = default;

        InstalledFont(CTFontDescriptorRef fontDescriptor, AllowUserInstalledFonts allowUserInstalledFonts)
            : fontDescriptor(fontDescriptor)
            , capabilities(capabilitiesForFontDescriptor(fontDescriptor))
            if (allowUserInstalledFonts != AllowUserInstalledFonts::No)
            auto attributes = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
            addAttributesForInstalledFonts(attributes.get(), allowUserInstalledFonts);
            this->fontDescriptor = CTFontDescriptorCreateCopyWithAttributes(fontDescriptor, attributes.get());  // LEAK of CTFontDescriptorRef.  Missing adoptCF().

        RetainPtr<CTFontDescriptorRef> fontDescriptor;
        FontSelectionCapabilities capabilities;

Regressed in:

Bug 199769: Make sure to set kCTFontFallbackOptionAttribute to kCTFontFallbackOptionSystem for system fonts
Comment 1 David Kilzer (:ddkilzer) 2019-09-17 19:46:52 PDT
Comment 2 David Kilzer (:ddkilzer) 2019-09-17 19:52:13 PDT
Created attachment 379014 [details]
Patch v1
Comment 3 Brent Fulgham 2019-09-17 20:26:40 PDT
Comment on attachment 379014 [details]
Patch v1

Comment 4 WebKit Commit Bot 2019-09-18 04:30:23 PDT
Comment on attachment 379014 [details]
Patch v1

Clearing flags on attachment: 379014

Committed r250031: <https://trac.webkit.org/changeset/250031>
Comment 5 WebKit Commit Bot 2019-09-18 04:30:24 PDT
All reviewed patches have been landed.  Closing bug.