Commit a5bfa1a2 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Properly destroy context in two places.

Whenever ME_InitContext is called, ME_DestroyContext should be used to clean it up. This way the context can be extended easily by modifying those two functions. Instead, these two places of code just released the DC, without using ME_DestroyContext, so the created brush for the margin was not deleted.
parent ea9e062b
......@@ -600,7 +600,7 @@ int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset)
{
if (nOffset)
ME_GetOLEObjectSize(&c, pRun, &size);
ITextHost_TxReleaseDC(editor->texthost, c.hDC);
ME_DestroyContext(&c);
return nOffset != 0;
} else if (pRun->nFlags & MERF_ENDPARA) {
nOffset = 0;
......@@ -612,7 +612,7 @@ int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset)
strRunText = pRun->strText;
ME_GetTextExtent(&c, strRunText->szData, nOffset, pRun->style, &size);
ITextHost_TxReleaseDC(editor->texthost, c.hDC);
ME_DestroyContext(&c);
if (editor->cPasswordMask)
ME_DestroyString(strRunText);
return size.cx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment