Bug 163769 - [Win][Direct2D] Correct some memory leaks and other minor bugs
Summary: [Win][Direct2D] Correct some memory leaks and other minor bugs
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Blocks: 161817
  Show dependency treegraph
Reported: 2016-10-20 17:56 PDT by Brent Fulgham
Modified: 2016-10-21 10:26 PDT (History)
7 users (show)

See Also:

Patch (16.57 KB, patch)
2016-10-20 18:08 PDT, Brent Fulgham
achristensen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
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]

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?