Explorar o código

HPCC-13941 Make unicode conversions thread safe.

Previous fix would core if used with threadpools (i.e. in Roxie).

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman %!s(int64=10) %!d(string=hai) anos
pai
achega
6113b63b48
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      rtl/eclrtl/eclrtl.cpp

+ 4 - 0
rtl/eclrtl/eclrtl.cpp

@@ -314,8 +314,12 @@ CriticalSection ucmCrit;
 static void clearUnicodeConverterMap()
 {
     delete unicodeConverterMap;
+    unicodeConverterMap = NULL;  // Important to clear, as this is called when threadpool threads end...
     if (prevThreadTerminator)
+    {
         (*prevThreadTerminator)();
+        prevThreadTerminator = NULL;
+    }
 }
 
 RTLUnicodeConverter * queryRTLUnicodeConverter(char const * codepage)