mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:46:17 +00:00
[TASKMGR]
fix HMENU leak in TaskManager_OnTabWndSelChange CORE-8705 svn path=/trunk/; revision=64972
This commit is contained in:
parent
40369c24e3
commit
2c42dec0d7
1 changed files with 8 additions and 2 deletions
|
@ -38,6 +38,8 @@ HWND hMainWnd; /* Main Window */
|
|||
HWND hStatusWnd; /* Status Bar Window */
|
||||
HWND hTabWnd; /* Tab Control Window */
|
||||
|
||||
HMENU hWindowMenu = NULL;
|
||||
|
||||
int nMinimumWidth; /* Minimum width of the dialog (OnSize()'s cx) */
|
||||
int nMinimumHeight; /* Minimum height of the dialog (OnSize()'s cy) */
|
||||
|
||||
|
@ -187,6 +189,8 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
|
|||
SaveSettings();
|
||||
PerfDataUninitialize();
|
||||
CloseHandle(hMutex);
|
||||
if (hWindowMenu)
|
||||
DestroyMenu(hWindowMenu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -974,6 +978,8 @@ void TaskManager_OnTabWndSelChange(void)
|
|||
RemoveMenu(hViewMenu, i, MF_BYPOSITION);
|
||||
}
|
||||
RemoveMenu(hOptionsMenu, 3, MF_BYPOSITION);
|
||||
if (hWindowMenu)
|
||||
DestroyMenu(hWindowMenu);
|
||||
switch (TaskManagerSettings.ActiveTabPage) {
|
||||
case 0:
|
||||
ShowWindow(hApplicationPage, SW_SHOW);
|
||||
|
@ -991,10 +997,10 @@ void TaskManager_OnTabWndSelChange(void)
|
|||
AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_DETAILS, szTemp);
|
||||
|
||||
if (GetMenuItemCount(hMenu) <= 5) {
|
||||
hSubMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_WINDOWSMENU));
|
||||
hWindowMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_WINDOWSMENU));
|
||||
|
||||
LoadStringW(hInst, IDS_MENU_WINDOWS, szTemp, 256);
|
||||
InsertMenuW(hMenu, 3, MF_BYPOSITION|MF_POPUP, (UINT_PTR) hSubMenu, szTemp);
|
||||
InsertMenuW(hMenu, 3, MF_BYPOSITION|MF_POPUP, (UINT_PTR) hWindowMenu, szTemp);
|
||||
|
||||
DrawMenuBar(hMainWnd);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue