From 3deb3adee6a750caca115bd3715d47720463691f Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Fri, 12 Dec 2003 16:56:20 +0000 Subject: [PATCH] don't unlink a window that has no parent window svn path=/trunk/; revision=6970 --- reactos/subsys/win32k/ntuser/window.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/reactos/subsys/win32k/ntuser/window.c b/reactos/subsys/win32k/ntuser/window.c index 9b1d2af5d30..41a8966a15e 100644 --- a/reactos/subsys/win32k/ntuser/window.c +++ b/reactos/subsys/win32k/ntuser/window.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: window.c,v 1.157 2003/12/12 14:22:37 gvg Exp $ +/* $Id: window.c,v 1.158 2003/12/12 16:56:20 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -358,9 +358,12 @@ static LRESULT IntDestroyWindow(PWINDOW_OBJECT Window, CLASS_RemoveWindow(Window->Class); #endif - ExAcquireFastMutexUnsafe(&Window->Parent->ChildrenListLock); - IntUnlinkWindow(Window); - ExReleaseFastMutexUnsafe(&Window->Parent->ChildrenListLock); + if(Window->Parent) + { + ExAcquireFastMutexUnsafe(&Window->Parent->ChildrenListLock); + IntUnlinkWindow(Window); + ExReleaseFastMutexUnsafe(&Window->Parent->ChildrenListLock); + } ExAcquireFastMutexUnsafe (&ThreadData->WindowListLock); RemoveEntryList(&Window->ThreadListEntry);