Author: cgutman
Date: Tue Aug 2 22:18:57 2011
New Revision: 53037
URL:
http://svn.reactos.org/svn/reactos?rev=53037&view=rev
Log:
[NETSHELL]
- Fix icon handle leaks in the network status taskbar icon
Modified:
trunk/reactos/dll/win32/netshell/lanstatusui.c
Modified: trunk/reactos/dll/win32/netshell/lanstatusui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/lanstat…
==============================================================================
--- trunk/reactos/dll/win32/netshell/lanstatusui.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netshell/lanstatusui.c [iso-8859-1] Tue Aug 2 22:18:57 2011
@@ -251,6 +251,9 @@
}
Shell_NotifyIconW(NIM_MODIFY, &nid);
+
+ if (nid.uFlags & NIF_ICON)
+ DestroyIcon(nid.hIcon);
pContext->dwInOctets = IfEntry.dwInOctets;
pContext->dwOutOctets = IfEntry.dwOutOctets;
@@ -1002,7 +1005,7 @@
ZeroMemory(&nid, sizeof(nid));
nid.cbSize = sizeof(nid);
nid.uID = Index++;
- nid.uFlags = NIF_ICON | NIF_MESSAGE;
+ nid.uFlags = NIF_MESSAGE;
nid.u.uVersion = 3;
nid.uCallbackMessage = WM_SHOWSTATUSDLG;
nid.hWnd = hwndDlg;
@@ -1022,6 +1025,8 @@
else if (pProps->Status == NCS_CONNECTED)
nid.hIcon = LoadIcon(netshell_hInstance,
MAKEINTRESOURCE(IDI_NET_IDLE));
+ if (nid.hIcon)
+ nid.uFlags |= NIF_ICON;
wcscpy(nid.szTip, pProps->pszwName);
nid.uFlags |= NIF_TIP;
@@ -1043,6 +1048,9 @@
{
CoTaskMemFree(pItem);
}
+
+ if (nid.uFlags & NIF_ICON)
+ DestroyIcon(nid.hIcon);
}
}
}while(hr == S_OK);