diff options
-rw-r--r-- | src/client.cpp | 2 | ||||
-rw-r--r-- | src/utils/translation/translationmanager.cpp | 6 | ||||
-rw-r--r-- | src/utils/translation/translationmanager.h | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index cb65c3b60..3e8eef6ed 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -798,6 +798,8 @@ void Client::gameClear() //delete logger; //logger = nullptr; + TranslationManager::close(); + mInstance = nullptr; } diff --git a/src/utils/translation/translationmanager.cpp b/src/utils/translation/translationmanager.cpp index b4ae0d949..1b68cc91d 100644 --- a/src/utils/translation/translationmanager.cpp +++ b/src/utils/translation/translationmanager.cpp @@ -46,6 +46,12 @@ void TranslationManager::loadCurrentLang() translator = loadLang(getLang()); } +void TranslationManager::close() +{ + delete translator; + translator = nullptr; +} + PoDict *TranslationManager::loadLang(LangVect lang) { std::string name = ""; diff --git a/src/utils/translation/translationmanager.h b/src/utils/translation/translationmanager.h index de3875b0a..39702f4f4 100644 --- a/src/utils/translation/translationmanager.h +++ b/src/utils/translation/translationmanager.h @@ -33,6 +33,8 @@ class TranslationManager static void init(); + static void close(); + static void loadCurrentLang(); }; |