From f9b468e4060f24da842173dd6733f36e2a4927cb Mon Sep 17 00:00:00 2001 From: etkmao Date: Sat, 7 Oct 2023 11:11:11 +0800 Subject: [PATCH] fix(v8): v8 code cache file broken protect --- android/sdk/src/main/jni/src/bridge/entry.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android/sdk/src/main/jni/src/bridge/entry.cc b/android/sdk/src/main/jni/src/bridge/entry.cc index 8e543592e85..ac9568d606d 100644 --- a/android/sdk/src/main/jni/src/bridge/entry.cc +++ b/android/sdk/src/main/jni/src/bridge/entry.cc @@ -351,8 +351,10 @@ bool RunScriptInternal(const std::shared_ptr& runtime, if (!read_script_flag || StringViewUtils::IsEmpty(script_content)) { TDF_BASE_LOG(WARNING) << "read_script_flag = " << read_script_flag << ", script content empty, uri = " << uri; - std::lock_guard lock(code_cache_file_mutex); - CheckUseCodeCacheAfterRunScript(code_cache_path); + if (is_use_code_cache) { + std::lock_guard lock(code_cache_file_mutex); + CheckUseCodeCacheAfterRunScript(code_cache_path); + } return false; }