diff options
author | Neil <nyamatongwe@gmail.com> | 2020-07-28 10:43:42 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2020-07-28 10:43:42 +1000 |
commit | 551f029d0a86b0d6dcda6f85447634c396d9c0cc (patch) | |
tree | fd88bba2ac2a4eed9e5c9023ef1a1d1c597b5278 | |
parent | ba6c4fd91318ea24c1f9491a0a09c69b74a10ad3 (diff) | |
download | scintilla-mirror-551f029d0a86b0d6dcda6f85447634c396d9c0cc.tar.gz |
Backport: Fix factory leak by using global factory instead of getting from render target.
Backport of changeset 8461:3626579329d1.
-rw-r--r-- | win32/PlatWin.cxx | 5 |
1 files changed, 1 insertions, 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; |