From: Jactry Zeng Subject: [PATCH 1/3] riched20: Fix a leak. Message-Id: <544F879B.3030307@codeweavers.com> Date: Tue, 28 Oct 2014 20:10:03 +0800 For bug 36323: https://bugs.winehq.org/show_bug.cgi?id=36323 --- dlls/riched20/editor.c | 2 +- dlls/riched20/editor.h | 1 + dlls/riched20/txtsrv.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 3c0d970..a277510 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2863,7 +2863,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) return ed; } -static void ME_DestroyEditor(ME_TextEditor *editor) +void ME_DestroyEditor(ME_TextEditor *editor) { ME_DisplayItem *pFirst = editor->pBuffer->pFirst; ME_DisplayItem *p = pFirst, *pNext = NULL; diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index edbac8e..3987907 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -248,6 +248,7 @@ void ME_DeleteReObject(REOBJECT* reo) DECLSPEC_HIDDEN; /* editor.c */ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) DECLSPEC_HIDDEN; +void ME_DestroyEditor(ME_TextEditor *editor) DECLSPEC_HIDDEN; LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode, HRESULT* phresult) DECLSPEC_HIDDEN; void ME_SendOldNotify(ME_TextEditor *editor, int nCode) DECLSPEC_HIDDEN; diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c index 636efff..0ca1e1b 100644 --- a/dlls/riched20/txtsrv.c +++ b/dlls/riched20/txtsrv.c @@ -108,7 +108,7 @@ static ULONG WINAPI ITextServicesImpl_Release(IUnknown *iface) if (!ref) { - ITextHost_Release(This->pMyHost); + ME_DestroyEditor(This->editor); This->csTxtSrv.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->csTxtSrv); CoTaskMemFree(This);