Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-09-13 12:20:49 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-09-13 12:20:49 +0300
commit2be1d8bbafc8a3cedd4d2699ded260215bb07da2 (patch)
tree4699a7796783ff9feac31fbb226d1bee3acf2737 /source/blender/blentranslation/intern
parenta6fc7180297f855c2592b20b26f96eb8e5a9e0ca (diff)
Tentative fix for T56770: Crash after set language to Simplified Chinese.
That bug probably did not affect 2.7x, only 2.8 with COW copying IDs in threads... But root of the issue is that underlying boost i18n lib does not support well multi-threaded access. So simply forbid any translation from non-main thread. This *may* be an annoying limit at some point, but doubt it will be any issue currently.
Diffstat (limited to 'source/blender/blentranslation/intern')
-rw-r--r--source/blender/blentranslation/intern/blt_translation.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blentranslation/intern/blt_translation.c b/source/blender/blentranslation/intern/blt_translation.c
index 9175585f1b3..40d384dd0fe 100644
--- a/source/blender/blentranslation/intern/blt_translation.c
+++ b/source/blender/blentranslation/intern/blt_translation.c
@@ -41,6 +41,7 @@
#include "BLI_fileops.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
+#include "BLI_threads.h"
#include "DNA_userdef_types.h" /* For user settings. */
@@ -91,7 +92,7 @@ const char *BLT_pgettext(const char *msgctxt, const char *msgid)
bool BLT_translate(void)
{
#ifdef WITH_INTERNATIONAL
- return (U.transopts & USER_DOTRANSLATE) != 0;
+ return BLI_thread_is_main() && (U.transopts & USER_DOTRANSLATE);
#else
return false;
#endif
@@ -100,7 +101,7 @@ bool BLT_translate(void)
bool BLT_translate_iface(void)
{
#ifdef WITH_INTERNATIONAL
- return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_IFACE);
+ return BLT_translate() && (U.transopts & USER_TR_IFACE);
#else
return false;
#endif
@@ -109,7 +110,7 @@ bool BLT_translate_iface(void)
bool BLT_translate_tooltips(void)
{
#ifdef WITH_INTERNATIONAL
- return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_TOOLTIPS);
+ return BLT_translate() && (U.transopts & USER_TR_TOOLTIPS);
#else
return false;
#endif
@@ -118,7 +119,7 @@ bool BLT_translate_tooltips(void)
bool BLT_translate_new_dataname(void)
{
#ifdef WITH_INTERNATIONAL
- return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_NEWDATANAME);
+ return BLT_translate() && (U.transopts & USER_TR_NEWDATANAME);
#else
return false;
#endif