diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-31 12:34:45 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-31 12:34:45 +0300 |
commit | 7b5c945859e92b1921313da3bbd5dc332ac62910 (patch) | |
tree | 0d6cf893e76e3eee1bb913b7798e75695ae8d3cd /plugins/Clist_modern | |
parent | cffe05b54d4ebed92421397015f949ecfa6d6764 (diff) |
couple of memleak fixes
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/modern_clisttray.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 9f9f9a40af..14ce0aa1d1 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -411,7 +411,6 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) HICON hIcon = NULL;
int i = 0, iStatus;
- char *szProto;
switch (Mode) {
case TRAY_ICON_MODE_GLOBAL:
@@ -421,17 +420,19 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) case TRAY_ICON_MODE_ACC:
// В этом режиме показывается иконка совершенно определённого аккаунта, и не всегда это szChangedProto.
- szProto = db_get_sa(NULL, "CList", bDiffers ? "tiAccV" : "tiAccS");
- if (szProto == NULL)
- break;
+ {
+ ptrA szProto(db_get_sa(0, "CList", bDiffers ? "tiAccV" : "tiAccS"));
+ if (szProto == nullptr)
+ break;
- iStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
- if (g_StatusBarData.bConnectingIcon && IsStatusConnecting(iStatus))
- hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szProto, 0);
- else
- hIcon = pcli->pfnGetIconFromStatusMode(NULL, szProto, CallProtoService(szProto, PS_GETSTATUS, 0, 0));
+ iStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ if (g_StatusBarData.bConnectingIcon && IsStatusConnecting(iStatus))
+ hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szProto, 0);
+ else
+ hIcon = pcli->pfnGetIconFromStatusMode(NULL, szProto, CallProtoService(szProto, PS_GETSTATUS, 0, 0));
- pcli->pfnTrayIconMakeTooltip(NULL, szProto);
+ pcli->pfnTrayIconMakeTooltip(NULL, szProto);
+ }
break;
case TRAY_ICON_MODE_CYCLE:
|