don't unlink a window that has no parent window

svn path=/trunk/; revision=6970
This commit is contained in:
Thomas Bluemel 2003-12-12 16:56:20 +00:00
parent 224147dd48
commit 3deb3adee6

View file

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