summaryrefslogtreecommitdiff
path: root/zen/i18n.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2016-07-25 20:46:59 +0200
committerDaniel Wilhelm <daniel@wili.li>2016-07-25 20:46:59 +0200
commit37dab163d3ee934a56f7d4ef2423c973f20cd27a (patch)
tree050c0b1c35de989fa397faa34f7ed2a1df543e51 /zen/i18n.h
parent8.2 (diff)
downloadFreeFileSync-37dab163d3ee934a56f7d4ef2423c973f20cd27a.tar.gz
FreeFileSync-37dab163d3ee934a56f7d4ef2423c973f20cd27a.tar.bz2
FreeFileSync-37dab163d3ee934a56f7d4ef2423c973f20cd27a.zip
8.3
Diffstat (limited to 'zen/i18n.h')
-rw-r--r--zen/i18n.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/zen/i18n.h b/zen/i18n.h
index 77b3b57a..a32f116a 100644
--- a/zen/i18n.h
+++ b/zen/i18n.h
@@ -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));
}
bgstack15