From 4da1d7953a20c180e7659795bd50ca83b53b39cd Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 28 Jul 2020 10:43:42 +1000 Subject: Fix factory leak by using global factory instead of getting from render target. --- win32/PlatWin.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index bbf352ee6..d906d07f2 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -1440,11 +1440,8 @@ void SurfaceD2D::LineTo(int x_, int y_) { void SurfaceD2D::Polygon(Point *pts, size_t npts, ColourDesired fore, ColourDesired back) { PLATFORM_ASSERT(pRenderTarget && (npts > 2)); if (pRenderTarget) { - ID2D1Factory *pFactory = nullptr; - pRenderTarget->GetFactory(&pFactory); - PLATFORM_ASSERT(pFactory); ID2D1PathGeometry *geometry = nullptr; - HRESULT hr = pFactory->CreatePathGeometry(&geometry); + HRESULT hr = pD2DFactory->CreatePathGeometry(&geometry); PLATFORM_ASSERT(geometry); if (SUCCEEDED(hr) && geometry) { ID2D1GeometrySink *sink = nullptr; -- cgit v1.2.3