mirror of
https://github.com/reactos/reactos.git
synced 2025-04-26 00:20:34 +00:00
[NTUSER] Cleanup the window lists (#4346)
Cleanup the window lists that are no longer needed at the thread / process termination. CORE-11700
This commit is contained in:
parent
ce306b83db
commit
61d4b5fd6c
2 changed files with 20 additions and 0 deletions
|
@ -180,6 +180,12 @@ UserProcessDestroy(PEPROCESS Process)
|
|||
if (ppiScrnSaver == ppiCurrent)
|
||||
ppiScrnSaver = NULL;
|
||||
|
||||
if (gpwlCache)
|
||||
{
|
||||
ExFreePoolWithTag(gpwlCache, USERTAG_WINDOWLIST);
|
||||
gpwlCache = NULL;
|
||||
}
|
||||
|
||||
/* Destroy user objects */
|
||||
UserDestroyObjectsForOwner(gHandleTable, ppiCurrent);
|
||||
|
||||
|
@ -697,6 +703,7 @@ ExitThreadCallback(PETHREAD Thread)
|
|||
PPROCESSINFO ppiCurrent;
|
||||
PEPROCESS Process;
|
||||
PTHREADINFO ptiCurrent;
|
||||
PWINDOWLIST pwl, pwlNext;
|
||||
|
||||
Process = Thread->ThreadsProcess;
|
||||
|
||||
|
@ -714,6 +721,16 @@ ExitThreadCallback(PETHREAD Thread)
|
|||
|
||||
IsRemoveAttachThread(ptiCurrent);
|
||||
|
||||
if (gpwlList)
|
||||
{
|
||||
for (pwl = gpwlList; pwl; pwl = pwlNext)
|
||||
{
|
||||
pwlNext = pwl->pNextList;
|
||||
if (pwl->pti == ptiCurrent)
|
||||
IntFreeHwndList(pwl);
|
||||
}
|
||||
}
|
||||
|
||||
ptiCurrent->TIF_flags |= TIF_DONTATTACHQUEUE;
|
||||
ptiCurrent->pClientInfo->dwTIFlags = ptiCurrent->TIF_flags;
|
||||
|
||||
|
|
|
@ -90,6 +90,9 @@ typedef struct tagWINDOWLIST
|
|||
HWND ahwnd[ANYSIZE_ARRAY]; /* Terminated by HWND_TERMINATOR */
|
||||
} WINDOWLIST, *PWINDOWLIST;
|
||||
|
||||
extern PWINDOWLIST gpwlList;
|
||||
extern PWINDOWLIST gpwlCache;
|
||||
|
||||
#define WL_IS_BAD(pwl) ((pwl)->phwndEnd <= (pwl)->phwndLast)
|
||||
#define WL_CAPACITY(pwl) ((pwl)->phwndEnd - &((pwl)->ahwnd[0]))
|
||||
|
||||
|
|
Loading…
Reference in a new issue