mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-12-02 20:47:11 +00:00
commit
87920fe720
@ -473,7 +473,10 @@ ohos_shared_library("appkit_delegator") {
|
||||
}
|
||||
|
||||
config("application_context_manager_config") {
|
||||
include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context" ]
|
||||
include_dirs = [
|
||||
"${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
|
||||
"${ability_runtime_services_path}/common/include",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_shared_library("appkit_manager_helper") {
|
||||
@ -530,6 +533,7 @@ ohos_shared_library("application_context_manager") {
|
||||
|
||||
external_deps = [
|
||||
"ets_runtime:libark_jsruntime",
|
||||
"hilog:libhilog",
|
||||
"napi:ace_napi",
|
||||
]
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
#include "application_context_manager.h"
|
||||
|
||||
#include "hilog_tag_wrapper.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
namespace {
|
||||
@ -52,7 +54,10 @@ void ApplicationContextManager::AddGlobalObject(napi_env env,
|
||||
if (envData == nullptr) {
|
||||
return;
|
||||
}
|
||||
napi_add_env_cleanup_hook(env, HandleClean, static_cast<void*>(envData));
|
||||
auto ret = napi_add_env_cleanup_hook(env, HandleClean, static_cast<void*>(envData));
|
||||
if (ret != napi_status::napi_ok) {
|
||||
TAG_LOGE(AAFwkTag::APPKIT, "add hook err");
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(applicationContextMutex_);
|
||||
auto iter = applicationContextMap_.find(env);
|
||||
if (iter == applicationContextMap_.end()) {
|
||||
|
Loading…
Reference in New Issue
Block a user