diff options
author | George Hazan <ghazan@miranda.im> | 2017-04-04 17:12:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-04-04 17:12:36 +0300 |
commit | f5a06e8c7677cb29b100314d17b5931f85c3d33f (patch) | |
tree | 8ee401be5558d7f6e5148fed2adb8a79dcb9592a /src/core | |
parent | cb9750e8ef71c32441c34c169101c4329a9ac8b5 (diff) |
- GC_FONTSIZE considered useless;
- archaic linked list of modules replaced with the standard LIST<> which is much faster
- fix for the module destruction
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/stdmsg/src/chat_manager.cpp | 23 |
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; |