Fixed a memory leak in the Windows uiArea.

This commit is contained in:
Pietro Gagliardi 2015-10-09 12:41:01 -04:00
parent 56d0d35f83
commit 1d4e341583
2 changed files with 7 additions and 0 deletions

View File

@ -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);
}

View File

@ -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;