summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-03 21:15:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-03 21:15:30 +0000
commit44c5b35ef4f84a227a78bdee220809460f9314ba (patch)
treeecd43587740e8bcfb64456d337a0a1a4e64cf89f /src
parent81ff20eeeb59aa2c72b737d7c6e18baa1a2478d5 (diff)
fix for langpack reload
git-svn-id: http://svn.miranda-ng.org/main/trunk@291 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/core/modules.cpp4
-rw-r--r--src/modules/langpack/langpack.cpp12
2 files changed, 9 insertions, 7 deletions
diff --git a/src/core/modules.cpp b/src/core/modules.cpp
index c8d173f9a7..a0b6582d1c 100644
--- a/src/core/modules.cpp
+++ b/src/core/modules.cpp
@@ -134,7 +134,7 @@ void UnloadClcModule(void);
void UnloadContactListModule(void);
void UnloadEventsModule(void);
void UnloadIdleModule(void);
-void UnloadLangPackModule(void);
+void UnloadLangPackModule(bool);
void UnloadSslModule(void);
void UnloadNetlibModule(void);
void UnloadNewPlugins(void);
@@ -236,7 +236,7 @@ void UnloadDefaultModules(void)
UnloadUpdateNotifyModule();
UnloadNetlibModule();
UnloadSslModule();
- UnloadLangPackModule();
+ UnloadLangPackModule(true);
}
int InitialiseModularEngine(void)
diff --git a/src/modules/langpack/langpack.cpp b/src/modules/langpack/langpack.cpp
index cec6511386..01dd16365d 100644
--- a/src/modules/langpack/langpack.cpp
+++ b/src/modules/langpack/langpack.cpp
@@ -537,14 +537,16 @@ int LoadLangPackModule(void)
return 0;
}
-void UnloadLangPackModule()
+void UnloadLangPackModule(bool bRemoveAll)
{
if ( !bModuleInitialized ) return;
int i;
- for ( i=0; i < lMuuids.getCount(); i++ )
- mir_free( lMuuids[i] );
- lMuuids.destroy();
+ if ( bRemoveAll ) {
+ for ( i=0; i < lMuuids.getCount(); i++ )
+ mir_free( lMuuids[i] );
+ lMuuids.destroy();
+ }
LangPackEntry* p = langPack.entry;
for ( i=0; i < langPack.entryCount; i++, p++ ) {
@@ -574,7 +576,7 @@ INT_PTR ReloadLangpack(WPARAM wParam, LPARAM lParam)
if ( pszStr == NULL )
pszStr = langPack.filename;
- UnloadLangPackModule();
+ UnloadLangPackModule(false);
LoadLangPack(pszStr);
return 0;
}