summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdmsg/src/chat_manager.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp
index fe7a0c3db7..6d6eedf8bf 100644
--- a/src/core/stdmsg/src/chat_manager.cpp
+++ b/src/core/stdmsg/src/chat_manager.cpp
@@ -66,24 +66,26 @@ HIMAGELIST hIconsList;
GlobalLogSettings g_Settings;
+static void OnDestroyModule(MODULEINFO *mi)
+{
+ if (mi->hOnlineIcon) DestroyIcon(mi->hOnlineIcon);
+ if (mi->hOnlineTalkIcon) DestroyIcon(mi->hOnlineTalkIcon);
+ if (mi->hOfflineIcon) DestroyIcon(mi->hOfflineIcon);
+ if (mi->hOfflineTalkIcon) DestroyIcon(mi->hOfflineTalkIcon);
+}
+
static void OnCreateModule(MODULEINFO *mi)
{
- mi->OnlineIconIndex = ImageList_AddIcon(hIconsList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_ONLINE));
- mi->OfflineIconIndex = ImageList_AddIcon(hIconsList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_OFFLINE));
+ OnDestroyModule(mi);
- if (mi->hOnlineIcon) DestroyIcon(mi->hOnlineIcon);
+ mi->OnlineIconIndex = ImageList_AddIcon(hIconsList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_ONLINE));
mi->hOnlineIcon = ImageList_GetIcon(hIconsList, mi->OnlineIconIndex, ILD_TRANSPARENT);
-
- if (mi->hOnlineTalkIcon) DestroyIcon(mi->hOnlineTalkIcon);
mi->hOnlineTalkIcon = ImageList_GetIcon(hIconsList, mi->OnlineIconIndex, ILD_TRANSPARENT | INDEXTOOVERLAYMASK(1));
+ ImageList_AddIcon(hIconsList, mi->hOnlineTalkIcon);
- if (mi->hOfflineIcon) DestroyIcon(mi->hOfflineIcon);
+ mi->OfflineIconIndex = ImageList_AddIcon(hIconsList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_OFFLINE));
mi->hOfflineIcon = ImageList_GetIcon(hIconsList, mi->OfflineIconIndex, ILD_TRANSPARENT);
-
- if (mi->hOfflineTalkIcon) DestroyIcon(mi->hOfflineTalkIcon);
mi->hOfflineTalkIcon = ImageList_GetIcon(hIconsList, mi->OfflineIconIndex, ILD_TRANSPARENT | INDEXTOOVERLAYMASK(1));
-
- ImageList_AddIcon(hIconsList, mi->hOnlineTalkIcon);
ImageList_AddIcon(hIconsList, mi->hOfflineTalkIcon);
}
@@ -244,6 +246,7 @@ void Load_ChatModule()
pci = Chat_GetInterface(&data);
pci->OnCreateModule = OnCreateModule;
+ pci->OnDestroyModule = OnDestroyModule;
pci->OnReplaceSession = OnReplaceSession;
pci->OnLoadSettings = OnLoadSettings;