From: Mark Jansen mark.jansen@reactos.org
--- dlls/comctl32/edit.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/comctl32/edit.c b/dlls/comctl32/edit.c index 3111cda2a4b..d9831efa2ad 100644 --- a/dlls/comctl32/edit.c +++ b/dlls/comctl32/edit.c @@ -3403,12 +3403,18 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key) static LRESULT EDIT_WM_KillFocus(HTHEME theme, EDITSTATE *es) { UINT flags = RDW_INVALIDATE; + HWND hwndSelf = es->hwndSelf;
es->flags &= ~EF_FOCUSED; DestroyCaret(); if (!(es->style & ES_NOHIDESEL)) EDIT_InvalidateText(es, es->selection_start, es->selection_end); EDIT_NOTIFY_PARENT(es, EN_KILLFOCUS); + + /* Someone destroyed us in the EN_KILLFOCUS handler, so we can't use 'es' anymore */ + if (!IsWindow(hwndSelf)) + return 0; + /* Throw away left over scroll when we lose focus */ es->wheelDeltaRemainder = 0;