mirror of
https://github.com/openharmony/js_util_module.git
synced 2026-07-19 18:23:35 -04:00
Solve the crash problem of calling SetHwIcuDirectory
Solve the crash problem of calling SetHwIcuDirectory issue:https://gitee.com/openharmony/js_util_module/issues/I5J8DK Signed-off-by: xdmal <maxiaodong16@huawei.com>
This commit is contained in:
@@ -42,6 +42,11 @@ namespace OHOS::Util {
|
||||
}
|
||||
}
|
||||
label_ = i32Flag;
|
||||
{
|
||||
decodeLock_.lock();
|
||||
SetHwIcuDirectory();
|
||||
decodeLock_.unlock();
|
||||
}
|
||||
bool fatal =
|
||||
(i32Flag & static_cast<uint32_t>(ConverterFlags::FATAL_FLG)) ==
|
||||
static_cast<uint32_t>(ConverterFlags::FATAL_FLG);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#define UTIL_JS_TEXTDECODER_H_
|
||||
|
||||
#include <memory.h>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "napi/native_api.h"
|
||||
@@ -163,6 +164,7 @@ namespace OHOS::Util {
|
||||
uint32_t label_;
|
||||
std::string encStr_;
|
||||
TransformToolPointer tranTool_;
|
||||
std::mutex decodeLock_;
|
||||
};
|
||||
}
|
||||
#endif // UTIL_JS_TEXTDECODER_H_
|
||||
|
||||
Reference in New Issue
Block a user