Bug 163769

Summary: [Win][Direct2D] Correct some memory leaks and other minor bugs
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, commit-queue, dino, mmaxfield, pvollan, simon.fraser
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 161817    
Attachments:
Description Flags
Patch achristensen: review+

Description Brent Fulgham 2016-10-20 17:56:37 PDT
While playing with http://browserbench.org/MotionMark I discovered a few leaks, as well as some drawing errors.

This patch corrects a number of problems found while running the benchmark.
Comment 1 Brent Fulgham 2016-10-20 18:08:16 PDT
Created attachment 292301 [details]
Patch
Comment 2 Brent Fulgham 2016-10-21 10:14:18 PDT
Committed in r207681. <https://trac.webkit.org/changeset/207681>.
Comment 3 Simon Fraser (smfr) 2016-10-21 10:26:34 PDT
Comment on attachment 292301 [details]
Patch

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

> Source/WebCore/platform/graphics/win/GradientDirect2D.cpp:72
> +    if (m_gradient) {
> +        m_gradient->Release();
> +        m_gradient = nullptr;
> +    }

Can we use smart pointers?

> Source/WebCore/platform/graphics/win/PathDirect2D.cpp:74
> +    if (m_path)
> +        m_path->Release();

Can we use a smart pointer?