mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[KBSWITCH] Fix menu handle leak
This commit is contained in:
parent
b4f73f040f
commit
f974f02881
1 changed files with 7 additions and 4 deletions
|
@ -437,7 +437,8 @@ VOID DoUnregisterAltShiftHotKeys(HWND hwnd)
|
|||
LRESULT CALLBACK
|
||||
WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static HMENU hRightPopupMenu;
|
||||
static HMENU s_hMenu;
|
||||
static HMENU s_hRightPopupMenu;
|
||||
static UINT s_uTaskbarRestart;
|
||||
|
||||
switch (Message)
|
||||
|
@ -446,7 +447,9 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
SetHooks();
|
||||
AddTrayIcon(hwnd);
|
||||
hRightPopupMenu = GetSubMenu(LoadMenu(hInst, MAKEINTRESOURCE(IDR_POPUP)), 0);
|
||||
|
||||
s_hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_POPUP));
|
||||
s_hRightPopupMenu = GetSubMenu(s_hMenu, 0);
|
||||
|
||||
ActivateLayout(hwnd, ulCurrentLayoutNum);
|
||||
s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated"));
|
||||
|
@ -502,7 +505,7 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
else
|
||||
{
|
||||
TrackPopupMenu(hRightPopupMenu, 0, pt.x, pt.y, 0, hwnd, NULL);
|
||||
TrackPopupMenu(s_hRightPopupMenu, 0, pt.x, pt.y, 0, hwnd, NULL);
|
||||
}
|
||||
|
||||
PostMessage(hwnd, WM_NULL, 0, 0);
|
||||
|
@ -558,7 +561,7 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
DoUnregisterAltShiftHotKeys(hwnd);
|
||||
DeleteHooks();
|
||||
DestroyMenu(hRightPopupMenu);
|
||||
DestroyMenu(s_hMenu);
|
||||
DelTrayIcon(hwnd);
|
||||
PostQuitMessage(0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue