diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-07 20:20:17 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-07 20:20:17 +0000 |
commit | ba275795eba1936a3c395527cc55936a4dc02f9d (patch) | |
tree | 549685873bcc8e4e4447d8efa9c74ecab6af97ba /src/modules | |
parent | 284caa432d31130a2714ce6acb49826d55b8789d (diff) |
memory leak in Clist modern
git-svn-id: http://svn.miranda-ng.org/main/trunk@14060 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/clist/clisttray.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index f6983cb912..4a2d495b6d 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -169,27 +169,28 @@ int fnTrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int s if (cli.trayIcon[i].id == 0)
break;
- cli.trayIcon[i].id = TRAYICON_ID_BASE + i;
- cli.trayIcon[i].szProto = (char*)szProto;
- cli.trayIcon[i].hBaseIcon = cli.pfnGetIconFromStatusMode(NULL, szIconProto ? szIconProto : cli.trayIcon[i].szProto, status);
+ trayIconInfo_t &p = cli.trayIcon[i];
+ p.id = TRAYICON_ID_BASE + i;
+ p.szProto = (char*)szProto;
+ p.hBaseIcon = cli.pfnGetIconFromStatusMode(NULL, szIconProto ? szIconProto : p.szProto, status);
NOTIFYICONDATA nid = { SIZEOFNID };
nid.hWnd = hwnd;
- nid.uID = cli.trayIcon[i].id;
+ nid.uID = p.id;
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = TIM_CALLBACK;
- nid.hIcon = cli.trayIcon[i].hBaseIcon;
+ nid.hIcon = p.hBaseIcon;
if (cli.shellVersion >= 5)
nid.uFlags |= NIF_INFO;
- cli.pfnTrayIconMakeTooltip(NULL, cli.trayIcon[i].szProto);
+ cli.pfnTrayIconMakeTooltip(NULL, p.szProto);
if (!hasTips())
mir_tstrncpy(nid.szTip, cli.szTip, SIZEOF(nid.szTip));
- cli.trayIcon[i].ptszToolTip = mir_tstrdup(cli.szTip);
+ replaceStrT(p.ptszToolTip, cli.szTip);
Shell_NotifyIcon(NIM_ADD, &nid);
- cli.trayIcon[i].isBase = 1;
+ p.isBase = 1;
if (cli.trayIconCount == 1)
SetTaskBarIcon(cli.trayIcon[0].hBaseIcon, cli.szTip);
|