diff --git a/windows/area.c b/windows/area.c index 88901490..478fec57 100644 --- a/windows/area.c +++ b/windows/area.c @@ -56,6 +56,8 @@ static HRESULT doPaint(uiArea *a, ID2D1RenderTarget *rt, RECT *client, RECT *cli (*(ah->Draw))(ah, a, &dp); + freeContext(dp.Context); + return ID2D1RenderTarget_EndDraw(rt, NULL, NULL); } diff --git a/windows/draw.c b/windows/draw.c index 2ad16589..7862e2a2 100644 --- a/windows/draw.c +++ b/windows/draw.c @@ -262,6 +262,11 @@ uiDrawContext *newContext(ID2D1RenderTarget *rt) return c; } +void freeContext(uiDrawContext *c) +{ + uiFree(c); +} + static ID2D1Brush *makeSolidBrush(uiDrawBrush *b, ID2D1RenderTarget *rt, D2D1_BRUSH_PROPERTIES *props) { D2D1_COLOR_F color;