diff options
Diffstat (limited to '')
-rw-r--r-- | src/base/language.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/base/language.cpp b/src/base/language.cpp index 340cdac4..74766795 100644 --- a/src/base/language.cpp +++ b/src/base/language.cpp @@ -50,8 +50,22 @@ namespace usdx { } + void remove_element(std::pair<std::wstring, std::map<std::wstring, std::wstring>*> element) + { + if (element.second) { + element.second->clear(); + } + + delete element.second; + element.second = NULL; + } + Language::~Language(void) { + // clear memory for all elements in the map + std::for_each(translations.begin(), translations.end(), + remove_element); + translations.clear(); // remove reference from singleton to make regeneration possible instance = NULL; |