From 8e6ef0d196a2c9772225f2ac061721e11370d2e9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 6 Feb 2012 02:45:35 +0300 Subject: Fix memory leak on exit. --- src/utils/translation/translationmanager.cpp | 6 ++++++ src/utils/translation/translationmanager.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'src/utils') 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(); }; -- cgit v1.2.3-70-g09d2