richedit: Prevented a dereference of a freed pointer.
On WM_DESTROY the editor was getting freed, then it was used to obtain a handle to the editor. This patch moves it just before the editor is freed within ME_DestroyEditor.
This commit is contained in:
parent
a8a97091fe
commit
c9977df853
|
@ -2685,6 +2685,7 @@ void ME_DestroyEditor(ME_TextEditor *editor)
|
||||||
DeleteObject(editor->hbrBackground);
|
DeleteObject(editor->hbrBackground);
|
||||||
if(editor->lpOleCallback)
|
if(editor->lpOleCallback)
|
||||||
IUnknown_Release(editor->lpOleCallback);
|
IUnknown_Release(editor->lpOleCallback);
|
||||||
|
SetWindowLongPtrW(editor->hWnd, 0, 0);
|
||||||
OleUninitialize();
|
OleUninitialize();
|
||||||
|
|
||||||
FREE_OBJ(editor->pBuffer);
|
FREE_OBJ(editor->pBuffer);
|
||||||
|
@ -3821,7 +3822,6 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
|
||||||
}
|
}
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
ME_DestroyEditor(editor);
|
ME_DestroyEditor(editor);
|
||||||
SetWindowLongPtrW(editor->hWnd, 0, 0);
|
|
||||||
return 0;
|
return 0;
|
||||||
case WM_SETCURSOR:
|
case WM_SETCURSOR:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue