Bug 174228 - [Cocoa] CTParagraphStyle leak under WebCore::LinkImageLayout::LinkImageLayout
Summary: [Cocoa] CTParagraphStyle leak under WebCore::LinkImageLayout::LinkImageLayout
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-06 16:28 PDT by Joseph Pecoraro
Modified: 2017-07-06 17:00 PDT (History)
5 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (1.43 KB, patch)
2017-07-06 16:30 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2017-07-06 16:28:25 PDT
Summary:
Checking for leaks I came across a CTParagraphStyle Leak:

Leak: 0x6180002dbc10  size=112  zone: DefaultMallocZone_0x10a316000   CTParagraphStyle  CFType  CoreText
	Call stack: [thread 0x7fff5a805340]: 
        | start 
        | main 
        | NSApplicationMain 
        | -[NSApplication run] 
        | -[NSApplication(NSEvent) sendEvent:] 
        | -[NSWindow(NSEventRouting) sendEvent:] 
        | -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] 
        | -[WebHTMLView mouseDragged:] 
        | WebCore::EventHandler::mouseDragged(NSEvent*, NSEvent*) 
        | WebCore::EventHandler::handleMouseMoveEvent(WebCore::PlatformMouseEvent const&, WebCore::HitTestResult*, bool) 
        | WebCore::EventHandler::handleMouseDraggedEvent(WebCore::MouseEventWithHitTestResults const&, WebCore::CheckDragHysteresis) 
        | WebCore::EventHandler::handleDrag(WebCore::MouseEventWithHitTestResults const&, WebCore::CheckDragHysteresis) 
        | WebCore::DragController::startDrag(WebCore::Frame&, WebCore::DragState const&, WebCore::DragOperation, WebCore::PlatformMouseEvent const&, WebCore::IntPoint const&) 
        | WebCore::createDragImageForLink(WebCore::Element&, WebCore::URL&, WTF::String const&, WebCore::TextIndicatorData&, WebCore::FontRenderingMode, float) 
        | WebCore::LinkImageLayout::LinkImageLayout(WebCore::URL&, WTF::String const&) 
        | WebCore::LinkImageLayout::LinkImageLayout(WebCore::URL&, WTF::String const&)::$_0::operator()(NSString*, NSColor*, NSFont*, long, CTLineBreakMode) const 
        | CTParagraphStyleCreate 
        | _CFRuntimeCreateInstance 

Should be adopting the Create into a RetainPtr:

    RetainPtr<CTParagraphStyleRef> paragraphStyle = CTParagraphStyleCreate(paragraphStyleSettings, 1);
Comment 1 Joseph Pecoraro 2017-07-06 16:30:48 PDT
Created attachment 314775 [details]
[PATCH] Proposed Fix
Comment 2 WebKit Commit Bot 2017-07-06 17:00:33 PDT
Comment on attachment 314775 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 314775

Committed r219226: <http://trac.webkit.org/changeset/219226>
Comment 3 WebKit Commit Bot 2017-07-06 17:00:34 PDT
All reviewed patches have been landed.  Closing bug.