Dylan Smith : richedit: Properly destroy context in two places.

Alexandre Julliard julliard at winehq.org
Fri Feb 6 09:56:03 CST 2009


Module: wine
Branch: master
Commit: a5bfa1a2abfa20f85df0396b74822106a6795c89
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a5bfa1a2abfa20f85df0396b74822106a6795c89

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Fri Feb  6 01:09:43 2009 -0500

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.

---

 dlls/riched20/run.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c
index 1f8cc18..741a469 100644
--- a/dlls/riched20/run.c
+++ b/dlls/riched20/run.c
@@ -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;




More information about the wine-cvs mailing list