mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
[TASKMGR]
fix some more memory leaks CORE-9473 svn path=/trunk/; revision=67176
This commit is contained in:
parent
24af2268eb
commit
d0ab5ca8f8
2 changed files with 20 additions and 2 deletions
|
@ -89,6 +89,23 @@ GetSystemColorDepth(VOID)
|
|||
return ColorDepth;
|
||||
}
|
||||
|
||||
void AppPageCleanup(void)
|
||||
{
|
||||
int i;
|
||||
LV_ITEM item;
|
||||
LPAPPLICATION_PAGE_LIST_ITEM pData;
|
||||
for (i = 0; i < ListView_GetItemCount(hApplicationPageListCtrl); i++)
|
||||
{
|
||||
memset(&item, 0, sizeof(LV_ITEM));
|
||||
item.mask = LVIF_PARAM;
|
||||
item.iItem = i;
|
||||
(void)ListView_GetItem(hApplicationPageListCtrl, &item);
|
||||
pData = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
|
||||
HeapFree(GetProcessHeap(), 0, pData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INT_PTR CALLBACK
|
||||
ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -151,6 +168,7 @@ ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
#ifdef RUN_APPS_PAGE
|
||||
EndLocalThread(&hApplicationThread, dwApplicationThread);
|
||||
#endif
|
||||
AppPageCleanup();
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
|
|
|
@ -330,12 +330,12 @@ void PerfDataRefresh(void)
|
|||
}
|
||||
|
||||
/* Now alloc a new PERFDATA array and fill in the data */
|
||||
pPerfData = (PPERFDATA)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PERFDATA) * ProcessCount);
|
||||
if (pPerfDataOld) {
|
||||
HeapFree(GetProcessHeap(), 0, pPerfDataOld);
|
||||
}
|
||||
pPerfDataOld = pPerfData;
|
||||
/* Clear out process perf data structures with HEAP_ZERO_MEMORY flag: */
|
||||
pPerfData = (PPERFDATA)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PERFDATA) * ProcessCount);
|
||||
|
||||
pSPI = (PSYSTEM_PROCESS_INFORMATION)pBuffer;
|
||||
for (Idx=0; Idx<ProcessCount; Idx++) {
|
||||
/* Get the old perf data for this process (if any) */
|
||||
|
|
Loading…
Reference in a new issue