⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278323 in webkit


Ignore:
Timestamp:
Jun 1, 2021, 1:08:28 PM (5 years ago)
Author:
Fujii Hironori
Message:

[WinCairo] GraphicsContextCairo::GraphicsContextCairo(HDC, bool) leaks cairo_t
https://bugs.webkit.org/show_bug.cgi?id=226317

Reviewed by Don Olmstead.

  • platform/graphics/win/GraphicsContextCairoWin.cpp:

(WebCore::createCairoContextWithHDC): Changed the return type from cairo_t* to RefPtr<cairo_t>.
(WebCore::GraphicsContextCairo::GraphicsContextCairo):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r278316 r278323  
     12021-06-01  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [WinCairo] GraphicsContextCairo::GraphicsContextCairo(HDC, bool) leaks cairo_t
     4        https://bugs.webkit.org/show_bug.cgi?id=226317
     5
     6        Reviewed by Don Olmstead.
     7
     8        * platform/graphics/win/GraphicsContextCairoWin.cpp:
     9        (WebCore::createCairoContextWithHDC): Changed the return type from cairo_t* to RefPtr<cairo_t>.
     10        (WebCore::GraphicsContextCairo::GraphicsContextCairo):
     11
    1122021-06-01  Philippe Normand  <pnormand@igalia.com>
    213
  • trunk/Source/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp

    r278149 r278323  
    3131#include "GraphicsContextCairo.h"
    3232#include "Path.h"
     33#include "RefPtrCairo.h"
    3334
    3435#include <cairo-win32.h>
     
    3940
    4041#if PLATFORM(WIN)
    41 static cairo_t* createCairoContextWithHDC(HDC hdc, bool hasAlpha)
     42static RefPtr<cairo_t> createCairoContextWithHDC(HDC hdc, bool hasAlpha)
    4243{
    4344    // Put the HDC In advanced mode so it will honor affine transforms.
     
    6162    }
    6263
    63     cairo_t* context = cairo_create(surface);
     64    auto context = adoptRef(cairo_create(surface));
    6465    cairo_surface_destroy(surface);
    6566
     
    6869
    6970GraphicsContextCairo::GraphicsContextCairo(HDC dc, bool hasAlpha)
    70     : GraphicsContextCairo(createCairoContextWithHDC(dc, hasAlpha))
     71    : GraphicsContextCairo(createCairoContextWithHDC(dc, hasAlpha).get())
    7172{
    7273}
Note: See TracChangeset for help on using the changeset viewer.