From ba275795eba1936a3c395527cc55936a4dc02f9d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 7 Jun 2015 20:20:17 +0000 Subject: memory leak in Clist modern git-svn-id: http://svn.miranda-ng.org/main/trunk@14060 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/clist/clisttray.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/modules/clist') 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); -- cgit v1.2.3