summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-05 12:09:04 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-05 12:09:04 +0000
commit890ee0ed05198e63877834f8c6ecc6bf80895aa5 (patch)
tree7356282088ee335df26d0defd03f15c4787dabb2
parente624819015f2d4d5b3102d3395a0466f6b3d6549 (diff)
clist_modern crashes on langpack reload
[fixes: #252] git-svn-id: http://svn.miranda-ng.org/main/trunk@3894 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_clistsettings.cpp9
2 files changed, 12 insertions, 3 deletions
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index 4384d36ffa..3a102bd281 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -34,6 +34,8 @@ pfnMyMonitorFromPoint MyMonitorFromPoint = NULL;
pfnMyMonitorFromWindow MyMonitorFromWindow = NULL;
pfnMyGetMonitorInfo MyGetMonitorInfo = NULL;
+int OnLoadLangpack(WPARAM, LPARAM);
+
static HANDLE hookSystemShutdown_CListMod = NULL;
HANDLE hookOptInitialise_CList = NULL,
hookOptInitialise_Skin = NULL,
@@ -225,6 +227,10 @@ HRESULT PreLoadContactListModule()
//clist interface is empty yet so handles should check
CreateServiceFunction(MS_CLIST_GETCONTACTICON, GetContactIcon);
CreateServiceFunction(MS_CLUI_GETCAPS, GetCapsService);
+
+ // catch langpack events
+ HookEvent(ME_LANGPACK_CHANGED, OnLoadLangpack);
+ OnLoadLangpack(0, 0);
return S_OK;
}
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp
index b3ad5d72e1..dd241971ee 100644
--- a/plugins/Clist_modern/src/modern_clistsettings.cpp
+++ b/plugins/Clist_modern/src/modern_clistsettings.cpp
@@ -377,9 +377,6 @@ void ClcCacheEntry::freeName()
void ClcCacheEntry::getName()
{
- if (UnknownConctactTranslatedName == NULL)
- UnknownConctactTranslatedName = TranslateT("(Unknown Contact)");
-
freeName();
if (m_cache_bProtoNotExists || !m_cache_cszProto) {
@@ -526,3 +523,9 @@ int PostAutoRebuidMessage(HWND hwnd)
CLM_AUTOREBUILD_WAS_POSTED = PostMessage(hwnd,CLM_AUTOREBUILD, 0, 0);
return CLM_AUTOREBUILD_WAS_POSTED;
}
+
+int OnLoadLangpack(WPARAM, LPARAM)
+{
+ UnknownConctactTranslatedName = TranslateT("(Unknown Contact)");
+ return 0;
+}