summaryrefslogtreecommitdiff
path: root/src/modules/icolib/skin2icons.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-04 19:11:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-04 19:11:17 +0000
commitd7f143dba9e53347a1d7897bcd3989751c7f45f8 (patch)
treebb464bed05487cb48d2221dee5840d943fa0b8d1 /src/modules/icolib/skin2icons.cpp
parent3f918fb53343d815ba8736735d1c0beea2359b15 (diff)
wiping objects during dynamic plugin unload
git-svn-id: http://svn.miranda-ng.org/main/trunk@762 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/icolib/skin2icons.cpp')
-rw-r--r--src/modules/icolib/skin2icons.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp
index 6527d7a35e..62ab6b15cf 100644
--- a/src/modules/icolib/skin2icons.cpp
+++ b/src/modules/icolib/skin2icons.cpp
@@ -101,7 +101,6 @@ void __fastcall SafeDestroyIcon(HICON* icon)
*icon = NULL;
} }
-
// Helper functions to manage Icon resources
IconSourceFile* IconSourceFile_Get(const TCHAR* file, bool isPath)
@@ -589,6 +588,25 @@ static INT_PTR IcoLib_RemoveIcon(WPARAM, LPARAM lParam)
return 1; // Failed
}
+void KillModuleIcons(int hLangpack)
+{
+ if ( !bModuleInitialized)
+ return;
+
+ mir_cslock lck(csIconList);
+ for (int i=iconList.getCount()-1; i >= 0; i--) {
+ IconItem *item = iconList[i];
+ if ( item->hLangpack == hLangpack) {
+ IcoLib_FreeIcon(item);
+ iconList.remove(i);
+ SAFE_FREE((void**)&item);
+ }
+ }
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// IconItem_GetDefaultIcon
+
HICON IconItem_GetDefaultIcon(IconItem* item, bool big)
{
HICON hIcon = NULL;
@@ -873,4 +891,5 @@ void UnloadIcoLibModule(void)
sectionList.destroy();
SafeDestroyIcon(&hIconBlank);
+ bModuleInitialized = false;
}