diff --git a/js_sys_module/timer/sys_timer.cpp b/js_sys_module/timer/sys_timer.cpp index 802afcb1135e87894affbaa1aede6fad3b801434..364665fc6deff44964cfe852bca9fa3279184047 100755 --- a/js_sys_module/timer/sys_timer.cpp +++ b/js_sys_module/timer/sys_timer.cpp @@ -189,7 +189,10 @@ void Timer::TimerCallback(uv_timer_t* handle) napi_call_function(env, undefinedValue, callback, callbackInfo->argc_, callbackArgv, &callbackResult); - Helper::CloseHelp::DeletePointer(callbackArgv, true); + { + std::lock_guard lock(timeLock); + Helper::CloseHelp::DeletePointer(callbackArgv, true); + } if (Helper::NapiHelper::IsExceptionPending(env)) { HILOG_ERROR("Pending exception in TimerCallback. Triggering HandleUncaughtException"); reinterpret_cast(env)->HandleUncaughtException();