diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-01 15:59:54 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-01 15:59:54 +0000 |
commit | 631e566f0728b637664f2a42a6d4031f8d5ac5dd (patch) | |
tree | 192b937e0a79a09fa5bd18265c7b9591afed4225 /src | |
parent | 36783e951cea109055a54123f03483ec0e026b00 (diff) |
patch not to destroy managed status line icons
git-svn-id: http://svn.miranda-ng.org/main/trunk@7441 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/srmm/statusicon.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/modules/srmm/statusicon.cpp b/src/modules/srmm/statusicon.cpp index 08107d9cc6..2b88911990 100644 --- a/src/modules/srmm/statusicon.cpp +++ b/src/modules/srmm/statusicon.cpp @@ -2,7 +2,7 @@ Miranda NG: the free IM client for Microsoft* Windows*
-Copyright (C) 2012-14 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -27,10 +27,8 @@ struct StatusIconChild : public MZeroedObject {
~StatusIconChild()
{
- if (hIcon)
- DestroyIcon(hIcon);
- if (hIconDisabled)
- DestroyIcon(hIconDisabled);
+ SafeDestroyIcon(hIcon);
+ SafeDestroyIcon(hIconDisabled);
mir_free(tszTooltip);
}
@@ -38,6 +36,15 @@ struct StatusIconChild : public MZeroedObject HICON hIcon, hIconDisabled;
int flags;
TCHAR *tszTooltip;
+
+ void SafeDestroyIcon(HICON hIcon)
+ {
+ if (hIcon == NULL)
+ return;
+
+ if (!IcoLib_IsManaged(hIcon))
+ ::DestroyIcon(hIcon);
+ }
};
struct StatusIconMain : public MZeroedObject
@@ -99,10 +106,7 @@ INT_PTR ModifyStatusIcon(WPARAM wParam, LPARAM lParam) pc->hContact = hContact;
p->arChildren.insert(pc);
}
- else {
- if (pc->hIcon)
- DestroyIcon(pc->hIcon);
- }
+ else pc->SafeDestroyIcon(pc->hIcon);
pc->flags = sid->flags;
pc->hIcon = sid->hIcon;
|