Author: cwittich
Date: Sun Apr 12 15:45:40 2015
New Revision: 67175
URL:
http://svn.reactos.org/svn/reactos?rev=67175&view=rev
Log:
[TASKMGR]
fix some memory leaks
Modified:
trunk/reactos/base/applications/taskmgr/perfdata.c
trunk/reactos/base/applications/taskmgr/procpage.c
Modified: trunk/reactos/base/applications/taskmgr/perfdata.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/perfdata.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/perfdata.c [iso-8859-1] Sun Apr 12 15:45:40
2015
@@ -105,6 +105,10 @@
pEntry = CONTAINING_RECORD(pCur, SIDTOUSERNAME, List);
pCur = pCur->Flink;
HeapFree(GetProcessHeap(), 0, pEntry);
+ }
+
+ if (SystemProcessorTimeInfo) {
+ HeapFree(GetProcessHeap(), 0, SystemProcessorTimeInfo);
}
}
Modified: trunk/reactos/base/applications/taskmgr/procpage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/procpage.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/procpage.c [iso-8859-1] Sun Apr 12 15:45:40
2015
@@ -59,6 +59,22 @@
DWORD WINAPI ProcessPageRefreshThread(void *lpParameter);
int ProcessRunning(ULONG ProcessId);
+void Cleanup(void)
+{
+ int i;
+ LV_ITEM item;
+ LPPROCESS_PAGE_LIST_ITEM pData;
+ for (i = 0; i < ListView_GetItemCount(hProcessPageListCtrl); i++)
+ {
+ memset(&item, 0, sizeof(LV_ITEM));
+ item.mask = LVIF_PARAM;
+ item.iItem = i;
+ (void)ListView_GetItem(hProcessPageListCtrl, &item);
+ pData = (LPPROCESS_PAGE_LIST_ITEM)item.lParam;
+ HeapFree(GetProcessHeap(), 0, pData);
+ }
+}
+
int ProcGetIndexByProcessId(DWORD dwProcessId)
{
int i;
@@ -170,6 +186,7 @@
EndLocalThread(&hProcessThread, dwProcessThread);
#endif
SaveColumnSettings();
+ Cleanup();
break;
case WM_COMMAND: