summaryrefslogtreecommitdiff
path: root/plugins/TipperYM
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-02-12 18:15:08 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-02-12 18:15:08 +0000
commit88d7709f7ce9d0b86d1ec7a220f357c5a922411c (patch)
tree85556fa0f08d9033e0b5f0e90319dc6186c5ce13 /plugins/TipperYM
parent36fd7d44957934f4fe6ddc1bb9597ae42519ad9d (diff)
icon leak fix for Tipper
git-svn-id: http://svn.miranda-ng.org/main/trunk@3578 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM')
-rw-r--r--plugins/TipperYM/src/popwin.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp
index ba3785c00a..808f1a7698 100644
--- a/plugins/TipperYM/src/popwin.cpp
+++ b/plugins/TipperYM/src/popwin.cpp
@@ -184,8 +184,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
mir_free(swzAdvTitle);
// get advanced status icon
if (pwd->bIsIconVisible[1]) {
- pwd->extraIcons[1].hIcon = (HICON)CallProtoService(pwd->clcit.szProto, PS_GETCUSTOMSTATUSICON, 0, 0);
- pwd->extraIcons[1].bDestroy = true;
+ pwd->extraIcons[1].hIcon = (HICON)CallProtoService(pwd->clcit.szProto, PS_GETCUSTOMSTATUSICON, 0, LR_SHARED);
+ pwd->extraIcons[1].bDestroy = false;
}
}
@@ -406,8 +406,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// fingerprint icon
if (pwd->bIsIconVisible[5]) {
- if (ServiceExists(MS_FP_GETCLIENTICONT)) {
- for (i = 0; opt.exIconsOrder[i] != 5; i++);
+ for (i = 0; opt.exIconsOrder[i] != 5; i++);
+ if ( ServiceExists(MS_FP_GETCLIENTICONT)) {
if (!DBGetContactSettingTString(pwd->hContact, szProto, "MirVer", &dbv)) {
pwd->extraIcons[i].hIcon = (HICON)CallService(MS_FP_GETCLIENTICONT, (WPARAM)dbv.ptszVal, 0);
pwd->extraIcons[i].bDestroy = true;
@@ -415,7 +415,6 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
}
else if (ServiceExists(MS_FP_GETCLIENTICON)) {
- for (i = 0; opt.exIconsOrder[i] != 5; i++);
if (!DBGetContactSettingString(pwd->hContact, szProto, "MirVer", &dbv)) {
pwd->extraIcons[i].hIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)dbv.pszVal, 0);
pwd->extraIcons[i].bDestroy = true;
@@ -952,9 +951,15 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->rows = NULL;
// destroy icons
- for (i = 0; i < EXICONS_COUNT; i++)
+ for (i = 0; i < EXICONS_COUNT; i++) {
+ if (pwd->extraIcons[i].hIcon == NULL)
+ continue;
+
if (pwd->extraIcons[i].bDestroy)
DestroyIcon(pwd->extraIcons[i].hIcon);
+ else
+ Skin_ReleaseIcon(pwd->extraIcons[i].hIcon);
+ }
if (pwd->clcit.swzText) {
mir_free(pwd->clcit.swzText);