aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-07-28 10:43:42 +1000
committerNeil <nyamatongwe@gmail.com>2020-07-28 10:43:42 +1000
commit4da1d7953a20c180e7659795bd50ca83b53b39cd (patch)
treea5fa82f33521496e9841fb65abcb6f828d93f977
parent5ab4ef6056f374474a6116d83191561ed810eda1 (diff)
downloadscintilla-mirror-4da1d7953a20c180e7659795bd50ca83b53b39cd.tar.gz
Fix factory leak by using global factory instead of getting from render target.
-rw-r--r--win32/PlatWin.cxx5
1 files changed, 1 insertions, 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;