From 551f029d0a86b0d6dcda6f85447634c396d9c0cc Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 28 Jul 2020 10:43:42 +1000 Subject: Backport: Fix factory leak by using global factory instead of getting from render target. Backport of changeset 8461:3626579329d1. --- win32/PlatWin.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index dcc92baa3..6cfb02328 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -1431,11 +1431,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