diff options
author | Daniel Wilhelm <daniel@wili.li> | 2016-07-25 20:46:59 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2016-07-25 20:46:59 +0200 |
commit | 37dab163d3ee934a56f7d4ef2423c973f20cd27a (patch) | |
tree | 050c0b1c35de989fa397faa34f7ed2a1df543e51 /zen/i18n.h | |
parent | 8.2 (diff) | |
download | FreeFileSync-37dab163d3ee934a56f7d4ef2423c973f20cd27a.tar.gz FreeFileSync-37dab163d3ee934a56f7d4ef2423c973f20cd27a.tar.bz2 FreeFileSync-37dab163d3ee934a56f7d4ef2423c973f20cd27a.zip |
8.3
Diffstat (limited to 'zen/i18n.h')
-rw-r--r-- | zen/i18n.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -115,8 +115,9 @@ struct CleanUpTranslationHandler { std::shared_ptr<const TranslationHandler>*& handler = getTranslationInstance(); assert(!handler); //clean up at a better time rather than during static destruction! MT issues! - delete handler; + auto oldHandler = handler; handler = nullptr; //getTranslator() may be called even after static objects of this translation unit are destroyed! + delete oldHandler; } }; } @@ -132,9 +133,9 @@ void setTranslator(std::unique_ptr<const TranslationHandler>&& newHandler) static implementation::CleanUpTranslationHandler cuth; //external linkage even in header! std::shared_ptr<const TranslationHandler>*& handler = implementation::getTranslationInstance(); - auto tmp = handler; + auto oldHandler = handler; handler = nullptr; - delete tmp; + delete oldHandler; if (newHandler) handler = new std::shared_ptr<const TranslationHandler>(std::move(newHandler)); } |