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);