diff --git a/windows/painting.c b/windows/painting.c index 3eb9f99e871..8ca4063357b 100644 --- a/windows/painting.c +++ b/windows/painting.c @@ -444,6 +444,12 @@ BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate, } } + if ( !IsWindow( hwnd ) ) + { + WIN_ReleaseWndPtr(wndPtr); + return TRUE; + } + /* Recursively process children */ if (!(flags & RDW_NOCHILDREN) && diff --git a/windows/x11drv/event.c b/windows/x11drv/event.c index a1bdbf87ffe..0abcbb44647 100644 --- a/windows/x11drv/event.c +++ b/windows/x11drv/event.c @@ -976,6 +976,8 @@ static void EVENT_ConfigureNotify( WND *pWnd, XConfigureEvent *event ) /* Send WM_WINDOWPOSCHANGING */ SendMessageA( winpos.hwnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)&winpos ); + + if (!IsWindow( winpos.hwnd )) return; /* Calculate new position and size */ newWindowRect.left = x; @@ -987,6 +989,8 @@ static void EVENT_ConfigureNotify( WND *pWnd, XConfigureEvent *event ) &pWnd->rectWindow, &pWnd->rectClient, &winpos, &newClientRect ); + if (!IsWindow( winpos.hwnd )) return; + hrgnOldPos = CreateRectRgnIndirect( &pWnd->rectWindow ); hrgnNewPos = CreateRectRgnIndirect( &newWindowRect ); CombineRgn( hrgnOldPos, hrgnOldPos, hrgnNewPos, RGN_DIFF );